diff --git a/test/parallel/test-worker-no-sab.js b/test/parallel/test-worker-no-sab.js new file mode 100644 index 00000000000000..ccd0f064be387b --- /dev/null +++ b/test/parallel/test-worker-no-sab.js @@ -0,0 +1,17 @@ +// Flags: --no-harmony-sharedarraybuffer + +'use strict'; + +const common = require('../common'); +const assert = require('assert') +const { isMainThread, Worker } = require('worker_threads'); + +// Regression test for https://github.com/nodejs/node/issues/39717. + +const w = new Worker(__filename); + +w.on('exit', common.mustCall((status) => { + assert.strictEqual(status, 2); +})); + +if (!isMainThread) process.exit(2);