You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to sue the visual regression plugin, but when I add it to my code I get websocket errors in my tests. Thank you.
Console output
~/Development/project% ./node_modules/.bin/web-test-runner test/components/test.js
test/components/test.js:
test [Chrome]
𐄂 works
❌ test > works
Error: Could not setup web socket connection. Are you executing this test through Web Test Runner?
at executeServerCommand (node_modules/@web/test-runner-commands/browser/commands.mjs:23:10)
at async visualDiff (node_modules/@web/test-runner-visual-regression/browser/commands.mjs:28:19)
at async n.<anonymous> (src/components/test.tsx:9:8)
Test
import Component from '.';
import { visualDiff } from '@web/test-runner-visual-regression';
import { render } from 'testUtils';
describe('Component', () => {
it('works', async () => {
const element = await render(<Component />);
await visualDiff(element.container, 'div');
});
});
I've investigated the defaults a bit and it looks like the default html loads a websocket module which isn't documented. I'm going to try injecting it to see if it fixes the problem. (Though there seems to be some other custom scripting as well.)
I finally figured out the reason it was failing was because I was bundling it using esbuild (external to web test runner.) My guess is that this library might be relying on globals. Is bundling worth supporting with this plugin?
I'm trying to sue the visual regression plugin, but when I add it to my code I get websocket errors in my tests. Thank you.
Console output
Test
command
Packages
configuration
The text was updated successfully, but these errors were encountered: