Skip to content

Commit d1c9869

Browse files
committed
Bump kcd-scripts to 11.x
1 parent b6a7c70 commit d1c9869

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@testing-library/jest-dom": "^5.11.6",
5151
"@types/react-dom": "^17.0.0",
5252
"dotenv-cli": "^4.0.0",
53-
"kcd-scripts": "^10.1.1",
53+
"kcd-scripts": "^11.1.0",
5454
"npm-run-all": "^4.1.5",
5555
"react": "^17.0.1",
5656
"react-dom": "^17.0.1",

src/__tests__/cleanup.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ describe('fake timers and missing act warnings', () => {
5454
jest.useRealTimers()
5555
})
5656

57-
test('cleanup does not flush immediates', () => {
57+
test('cleanup does not flush microtasks', () => {
5858
const microTaskSpy = jest.fn()
5959
function Test() {
6060
const counter = 1
6161
const [, setDeferredCounter] = React.useState(null)
6262
React.useEffect(() => {
6363
let cancelled = false
64-
setImmediate(() => {
64+
Promise.resolve().then(() => {
6565
microTaskSpy()
6666
// eslint-disable-next-line jest/no-if -- false positive
6767
if (!cancelled) {
@@ -93,12 +93,12 @@ describe('fake timers and missing act warnings', () => {
9393
const [, setDeferredCounter] = React.useState(null)
9494
React.useEffect(() => {
9595
let cancelled = false
96-
setImmediate(() => {
96+
setTimeout(() => {
9797
deferredStateUpdateSpy()
9898
if (!cancelled) {
9999
setDeferredCounter(counter)
100100
}
101-
})
101+
}, 0)
102102

103103
return () => {
104104
cancelled = true
@@ -109,7 +109,7 @@ describe('fake timers and missing act warnings', () => {
109109
}
110110
render(<Test />)
111111

112-
jest.runAllImmediates()
112+
jest.runAllTimers()
113113
cleanup()
114114

115115
expect(deferredStateUpdateSpy).toHaveBeenCalledTimes(1)

src/__tests__/no-act.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let act, asyncAct
22

33
beforeEach(() => {
44
jest.resetModules()
5-
act = require('..').act
5+
act = require('../pure').act
66
asyncAct = require('../act-compat').asyncAct
77
jest.spyOn(console, 'error').mockImplementation(() => {})
88
})

0 commit comments

Comments
 (0)