I’m using NestJS and the regular tests works smooth even in my Windows machine. However, when I tried running the debugging mode tests, especially since I’m trying to debug a memory leak, I get this error:
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^ SyntaxError: missing ) after argument list
I traced some of the discussions in Github like this:
It looks like the issue is due to this command:
What it does is it tries to run a script but since I’m in Windows, and the target script is a bash script, it doesn’t work. Running the Windows script
jest.cmd doesn’t work either since they are invoked from
node instead of from the command line interpreter.
I just changed the command to invoke the
JS script instead.
Works like charm!
node --expose-gc --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/jest/bin/jest.js --runInBand --logHeapUsage