Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't works with Node's Test Runner #283

Open
axetroy opened this issue Jan 24, 2025 · 2 comments
Open

Can't works with Node's Test Runner #283

axetroy opened this issue Jan 24, 2025 · 2 comments
Labels

Comments

@axetroy
Copy link

axetroy commented Jan 24, 2025

I followed the documentation to add the command

    "scripts": {
-        "test": "node --test --experimental-default-type=module",
+        "test": "0x -- node --test --experimental-default-type=module",
        "build": "echo 'Done'"
    },

Bug I got a unexpected error

$ npm run test

TypeError [ERR_INVALID_ARG_TYPE]: 
The "path" argument must be of type string. Received undefined
    at join (node:path:460:7)
    at C:\Users\Admin\AppData\Roaming\npm\node_modules\0x\index.js:90:27 {
  code: 'ERR_INVALID_ARG_TYPE'
}
node:internal/bootstrap/node:123
        validateInteger(value, 'code');
        ^

TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('ERR_INVALID_ARG_TYPE')
    at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
    at process.exit (node:internal/process/per_thread:178:24)
    at C:\Users\Admin\AppData\Roaming\npm\node_modules\0x\cmd.js:26:13 {
  code: 'ERR_INVALID_ARG_TYPE'
}

The root of the problem is here: args.pid is undefined

0x/index.js

Lines 87 to 92 in de66f0b

switch (args.kernelTracing ? platform : 'v8') {
case 'v8': return v8(args).catch((err) => {
const logFilePath = join(args.workingDir, v8.getIsolateLog(args.workingDir, args.pid))
let message = 'Fatal error in process observed by 0x. Incomplete V8 isolate log '
if (process.env.DEBUG && process.env.DEBUG.includes('0x')) {

@stefreak
Copy link

I'm having a similar problem using 0x together with Mocha

Copy link

github-actions bot commented Mar 2, 2025

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants