Skip to content
weftGitHub

Diagnostics

T013

A real WebSocket or EventSource in a fast test.

Fix: Use the fake transport: net.push, net.poke, net.drop.

Status in weft@0.1.0: reported by weft check on test files.

Triggers it:

tsx
test('feed', () => { const socket = new WebSocket('ws://localhost/feed'); expect(socket).toBeTruthy() })

A test that needs it on purpose keeps it with a reason: // weft-allow T013: <why> in the file header (whole file) or on the line above.

More: weft docs testing.