Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

345
Views
No se puede adjuntar un depurador mientras se ejecutan pruebas de broma

No puedo adjuntar el depurador de VS Code mientras ejecuto pruebas de broma. Intenté configurar el archivo launch.json con diferentes alternativas que encontré, pero siempre fallan con el siguiente mensaje de error, quejándose de un archivo en la carpeta node_modules:

 Debugger attached. Waiting for the debugger to disconnect... local\path\to\node_modules\.bin\jest:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list at wrapSafe (internal/modules/cjs/loader.js:979:16) at Module._compile (internal/modules/cjs/loader.js:1027:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47

Mi archivo package.json tiene la siguiente configuración:

 "scripts": { "compile": "tsc", "run": "node ./build/index.js", "execute": "tsc && node ./build/index.js", "test": "tsc && jest ./build/tests/*" }, "author": "roguib", "license": "ISC", "dependencies": { "@types/jest": "^26.0.20", "ts-jest": "^26.5.1", "ts-node": "^9.1.1" }, "devDependencies": { "@types/node": "^14.14.21", "jest": "^26.6.3" }

Mi launch.json :

 { "version": "0.2.0", "configurations": [ { "name": "Debug Jest Tests", "type": "node", "request": "launch", "runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" } ] }

fuente

Si ayuda, la ejecución de la prueba de ejecución npm run test normalmente ejecuta mi prueba de bromas, por lo que no estoy seguro de que sea algo relacionado con la broma en sí.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Parece que hay un error en Windows y la solución es apuntar VS Code directamente a jest.js en lugar de a la versión .bin:

Así que intenta reemplazar esto:

"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand"], con algo como:

"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js", "--runInBand", "--coverage", "false"],

https://github.com/facebook/jest/issues/3750

Además, si recibe otro error con respecto a la configuración de jest, agregue -c arg:

 "args": [ "--runInBand", "-c", "${workspaceFolder}/package/jest.config.js", ],
over 4 years ago · Santiago Trujillo Report

0

Resolví el problema instalando ts-jest y usando la siguiente configuración en launch.json .

 { "type": "node", "request": "launch", "name": "Jest All", "program": "${workspaceFolder}/node_modules/.bin/jest", "args": [ "--runInBand" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "disableOptimisticBPs": true, "windows": { "program": "${workspaceFolder}/node_modules/jest/bin/jest", } },

fuente

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!