-
-
Save millnitzluan/8bb6667b7aacb382bc8622058ed0bde9 to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const event_one = new Event('event_one'); | |
| const event_two = new Event('event_two'); | |
| const dispatch() => () => document.dispatchEvent(event_two); | |
| describe('test dispatch', () => { | |
| it('should dispatch event one', () => { | |
| document.dispatchEvent = jest.fn(); | |
| dispatch(); | |
| expect(document.dispatchEvent).toHaveBeenCalledWith(event_one) // true | |
| expect(document.dispatchEvent).toHaveBeenCalledWith(event_two) // true | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment