We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For a normal event this test runs fine:
fireEvent(window, new Event('message'));
However this:
fireEvent(window, new MessageEvent('message'));
throws: TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
This test worked previously when using jest
System: OS: macOS 12.3.1 CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz Memory: 186.50 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Watchman: 2022.02.21.00 - /usr/local/bin/watchman Browsers: Chrome: 103.0.5060.53 Firefox: 95.0.2 Safari: 15.4 npmPackages: @vitejs/plugin-react: 1.3.2 => 1.3.2 vite: 2.9.13 => 2.9.13 vitest: 0.17.0 => 0.17.0
npm
The text was updated successfully, but these errors were encountered:
For any others having this issue, this is a workaround:
const event = new Event('message'); (event as any).data = { test: 'test' } fireEvent(window, event);
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
For a normal event this test runs fine:
However this:
throws:
TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
This test worked previously when using jest
Reproduction
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: