We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dff90bc commit e12d056Copy full SHA for e12d056
test/common/index.js
@@ -46,13 +46,7 @@ const noop = () => {};
46
47
const hasCrypto = Boolean(process.versions.openssl);
48
49
-const isMainThread = (() => {
50
- if (require('module').builtinModules.includes('worker_threads')) {
51
- return require('worker_threads').isMainThread;
52
- }
53
- // Worker module not enabled → only a single main thread exists.
54
- return true;
55
-})();
+const { isMainThread } = require('worker_threads');
56
57
// Check for flags. Skip this for workers (both, the `cluster` module and
58
// `worker_threads`) and child processes.
0 commit comments