Skip to content

Commit 94ddf80

Browse files
committed
downgrade jest to support debugging tests in watch mode
1 parent a58a1f4 commit 94ddf80

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"babel-preset-env": "=1.6.1",
1313
"eslint": "=4.19.0",
1414
"eslint-plugin-compat": "=2.2.0",
15-
"jest": "=23.4.2",
15+
"jest": "=22.4.4",
1616
"jsdom": "=11.11.0",
1717
"prettier": "=1.11.1",
1818
"rollup": "=0.57.1",

test/subs/Keyboard.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@ describe("Keyboard subscription", () => {
77
const action = jest.fn()
88
const keyboardFx = Keyboard({ downs: true, action })
99
const { dispatch, unsubscribe } = runFx(keyboardFx)
10-
document.dispatchEvent(new KeyboardEvent("keydown", keyEvent))
10+
document.dispatchEvent(keyEvent)
1111
expect(dispatch).toBeCalledWith(action, keyEvent)
1212

1313
dispatch.mockReset()
1414
unsubscribe()
15-
document.dispatchEvent(new KeyboardEvent("keydown", keyEvent))
15+
document.dispatchEvent(keyEvent)
1616
expect(dispatch).not.toBeCalled()
1717
})
1818
it("should add and remove keyup listener", () => {
1919
const keyEvent = new KeyboardEvent("keyup", { key: "a", code: "KeyA" })
2020
const action = jest.fn()
2121
const keyboardFx = Keyboard({ ups: true, action })
2222
const { dispatch, unsubscribe } = runFx(keyboardFx)
23-
document.dispatchEvent(new KeyboardEvent("keyup", keyEvent))
23+
document.dispatchEvent(keyEvent)
2424
expect(dispatch).toBeCalledWith(action, keyEvent)
2525

2626
dispatch.mockReset()
2727
unsubscribe()
28-
document.dispatchEvent(new KeyboardEvent("keyup", keyEvent))
28+
document.dispatchEvent(keyEvent)
2929
expect(dispatch).not.toBeCalled()
3030
})
3131
it("should add and remove keypress listener", () => {
3232
const keyEvent = new KeyboardEvent("keypress", { key: "a", code: "KeyA" })
3333
const action = jest.fn()
3434
const keyboardFx = Keyboard({ presses: true, action })
3535
const { dispatch, unsubscribe } = runFx(keyboardFx)
36-
document.dispatchEvent(new KeyboardEvent("keypress", keyEvent))
36+
document.dispatchEvent(keyEvent)
3737
expect(dispatch).toBeCalledWith(action, keyEvent)
3838

3939
dispatch.mockReset()
4040
unsubscribe()
41-
document.dispatchEvent(new KeyboardEvent("keypress", keyEvent))
41+
document.dispatchEvent(keyEvent)
4242
expect(dispatch).not.toBeCalled()
4343
})
4444
})

0 commit comments

Comments
 (0)