Skip to content

Commit ce75f65

Browse files
committed
use explicit .then and .catch instead of .finally for node 8.x
1 parent 62eaac4 commit ce75f65

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

__tests__/purgeUnusedStyles.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ function suppressConsoleLogs(cb, type = 'warn') {
88
return () => {
99
const spy = jest.spyOn(global.console, type).mockImplementation(jest.fn())
1010

11-
return new Promise((resolve, reject) => {
11+
const promise = new Promise((resolve, reject) => {
1212
Promise.resolve(cb()).then(resolve, reject)
13-
}).finally(() => spy.mockRestore())
13+
})
14+
15+
promise.then(spy.mockRestor, spy.mockRestore)
16+
17+
return promise
1418
}
1519
}
1620

0 commit comments

Comments
 (0)