refactor: cleanup internal benchmark code
[poolifier.git] / tests / worker-files / thread / testWorker.js
index ccf55b56ba92d29e3848ecf0d19d37fe39f068e9..2b86fde282c6ed28106656164d7af1275b479b00 100644 (file)
@@ -1,10 +1,13 @@
 'use strict'
-const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
+const { ThreadWorker, KillBehaviors } = require('../../../lib')
 const { isMainThread } = require('worker_threads')
 const TestUtils = require('../../test-utils')
+const { WorkerFunctions } = require('../../test-types')
 
 function test (data) {
-  TestUtils.jsonIntegerSerialization(50)
+  data = data || {}
+  data.function = data.function || WorkerFunctions.jsonIntegerSerialization
+  TestUtils.executeWorkerFunction(data)
   return isMainThread
 }