diff --git a/test/objectwrap_worker_thread.js b/test/objectwrap_worker_thread.js index 3483099..5e5e50b 100644 --- a/test/objectwrap_worker_thread.js +++ b/test/objectwrap_worker_thread.js @@ -1,14 +1,15 @@ 'use strict'; -const buildType = process.config.target_defaults.default_configuration; -const { Worker, isMainThread } = require('worker_threads'); +const { Worker, isMainThread, workerData } = require('worker_threads'); if (isMainThread) { - new Worker(__filename); + const buildType = process.config.target_defaults.default_configuration; + new Worker(__filename, { workerData: buildType }); } else { const test = binding => { new binding.objectwrap.Test(); }; + const buildType = workerData; test(require(`./build/${buildType}/binding.node`)); test(require(`./build/${buildType}/binding_noexcept.node`)); }