test: do not use common.isMainThread

`common.isMainThread` was removed in
https://github.com/nodejs/node/commit/8caa1dcee63b2c6fd7a9, use the
`isMainThread` export of the `worker_threads` module instead.

PR-URL: https://github.com/nodejs/node/pull/56768
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Luigi Pinca authored and Antoine du Hamel committed 2025-01-30 10:44:36 +01:00
1 parent 575251ae6a
commit 85f7bbf4e4
1 file changed
+2 -1
@@ -3,8 +3,9 @@
const common = require('../common');
const assert = require('assert');
const fixtures = require('../common/fixtures');
const { isMainThread } = require('worker_threads');
if (!common.isMainThread)
if (!isMainThread)
common.skip('process.chdir is not available in Workers');
const subdir = fixtures.path('module-require', 'relative', 'subdir');