Files
node/test/wpt/test-encoding.js
Michaël Zasso 238104c531 test: move execution of WPT to worker threads
Running outside of the main Node.js context prevents us from upgrading
the WPT harness because new versions more aggressively check the
identity of globals like error constructors. Instead of exposing
globals used by the tests on vm sandboxes, use worker threads to run
everything.

PR-URL: https://github.com/nodejs/node/pull/34796
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-18 12:53:14 +02:00

12 lines
274 B
JavaScript

'use strict';
require('../common');
const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('encoding');
runner.setInitScript(`
const { MessageChannel } = require('worker_threads');
global.MessageChannel = MessageChannel;
`);
runner.runJsTests();