CONSOLE MESSAGE: WebSocket connection to 'ws://localhost:8880/non-existent-url' failed: Unexpected response code: 404
Test that readyState is CLOSED within onerror event

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

onerror() was called.
PASS ws.readyState is 3
PASS successfullyParsed is true

TEST COMPLETE

