mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/58517 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
18 lines
576 B
JavaScript
18 lines
576 B
JavaScript
// Flags: --permission --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto) {
|
|
common.skip('no crypto');
|
|
}
|
|
|
|
const wsUrl = 'ws://nodejs.org';
|
|
|
|
const ws = new WebSocket(wsUrl);
|
|
|
|
ws.addEventListener('open', common.mustNotCall('WebSocket connection should be blocked'));
|
|
// WebSocket implementation doesn't expose the Node.js specific errors
|
|
// so ERR_ACCESS_DENIED won't be "caught" explicitly.
|
|
// For now, let's just assert the error
|
|
// TODO(rafaelgss): make this test more comprehensive
|
|
ws.addEventListener('error', common.mustCall());
|