Relative Content

Tag Archive for node.jsvscode-debuggernode-test-runner

Debug native node test runner with VS Code

A mocha like test suite has been added to node and I would like to use the built in testing instead of depending on a third party test suite. However I’ve been unable to find a nice way of debugging the built in test suite with VS code. There seems to be an issue with the test runner and the matching of glob patterns. For example I can run this node -r ts-node/register --test "$(pwd)/test/temp.test.ts" and the tests in the temp.test.ts file are run as expected, however if I run this node -r ts-node/register --test "$(pwd)/test/**/*.test.ts" then i get this error: Could not find ‘/media/ben/data/dev/ptc-source/ptc/test/**/*.test.ts’. Reading the documentation for the Node Test Runner it seems that this should work but does not. With it not accepting a glob pattern I’m not sure how to nicely debug with built in VS Code debug tools. Does anyone have a solution to work around this?