X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker-files%2Fthread%2FtestWorker.js;h=5779e231d0903c49edb0d85bd225e8ff1b1027ef;hb=67e8ef11907ab8ae70740d7c9f4d5d225ed8d522;hp=773e11164014a35a01e3cfc0dfe3f8f797d46336;hpb=bf9549aef8a23a3931e19040dadb7f1e8e6422b5;p=poolifier.git diff --git a/tests/worker-files/thread/testWorker.js b/tests/worker-files/thread/testWorker.js index 773e1116..5779e231 100644 --- a/tests/worker-files/thread/testWorker.js +++ b/tests/worker-files/thread/testWorker.js @@ -1,11 +1,12 @@ 'use strict' -const { ThreadWorker, KillBehaviors } = require('../../../lib/index') -const { isMainThread } = require('worker_threads') -const TestUtils = require('../../test-utils') +const { ThreadWorker, KillBehaviors } = require('../../../lib') +const { executeWorkerFunction } = require('../../test-utils') +const { WorkerFunctions } = require('../../test-types') function test (data) { - TestUtils.jsonIntegerSerialization(100) - return isMainThread + data = data || {} + data.function = data.function || WorkerFunctions.jsonIntegerSerialization + return executeWorkerFunction(data) } module.exports = new ThreadWorker(test, {