Skip to content

Commit

Permalink
Update 'tests/node/main.test.js'
Browse files Browse the repository at this point in the history
  • Loading branch information
j-devel committed Feb 3, 2025
1 parent 47c2e8c commit e9292d5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/node/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ const __modPath = `${outDir}/${libName}.min.js`;
//const __modPath = `${outDir}/${libName}.js`; // dev
const Mod = require(__modPath);

test('load', () => {
expect(Mod.hasOwnProperty('Thread')).toBeTruthy();
expect(Mod.hasOwnProperty('ThreadWorker')).toBeTruthy();
});
describe(`Test Suite: using ${__modPath}`, () => {

// Skip if v10.x which requires `--experimental-worker` for 'worker_threads'
if (process.version > 'v12.') {
test('load', () => {
expect(Mod.hasOwnProperty('Thread')).toBeTruthy();
expect(Mod.hasOwnProperty('ThreadWorker')).toBeTruthy();
});

// kludge: make sure `global.require` inside `Mod` is available
global.require = require;
Expand Down Expand Up @@ -143,4 +142,4 @@ const _thw = new MyThreadWorker(this, { isNode: true });
expect(results[1]).toBe(101);
expect(results[2].startsWith('canceled:')).toBeTruthy();
});
}
}); // end of `describe()`

0 comments on commit e9292d5

Please sign in to comment.