mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Merge pull request #2269 from tailwindlabs/fix-promise-finally
use explicit .then and .catch instead of .finally for node 8.x
This commit is contained in:
commit
681e4d8f38
@ -8,9 +8,13 @@ function suppressConsoleLogs(cb, type = 'warn') {
|
||||
return () => {
|
||||
const spy = jest.spyOn(global.console, type).mockImplementation(jest.fn())
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
Promise.resolve(cb()).then(resolve, reject)
|
||||
}).finally(() => spy.mockRestore())
|
||||
})
|
||||
|
||||
promise.then(spy.mockRestor, spy.mockRestore)
|
||||
|
||||
return promise
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user