node can be started with various options. Especially interesting is the --inspect
flag:
node --inspect node_modules/.bin/jest some.spec.js
Is it possible to pass the --inspect
flag somehow to yarn run
? For example:
yarn run test --inspect some.spec.js
There is a similar question for npm run
, where it seems to be not possible.
I don't know that
yarn run ...
supports passing arguments to NodeJS, however, there are a couple of other options.You can use the NODE_OPTIONS environment variable to pass arguments to NodeJS. For example,
In the package.json, you can define a script to take advantage of this:
And as you mentioned, you can use NodeJS directly,
As far as I know, those may be your only two options. However, both options work for both NPM and Yarn.