Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ const noop = () => {};

const hasCrypto = Boolean(process.versions.openssl);

const isMainThread = (() => {
if (require('module').builtinModules.includes('worker_threads')) {
return require('worker_threads').isMainThread;
}
// Worker module not enabled → only a single main thread exists.
return true;
})();
const { isMainThread } = require('worker_threads');

// Check for flags. Skip this for workers (both, the `cluster` module and
// `worker_threads`) and child processes.
Expand Down