The stuff I've used to transpile an npm project with babel, enabling source map support for dev and unit tests (with mocha).
Running npm run test-only
should run your tests with on-the-fly transpiling, but I haven't figured out how to get stack
traces to be processed with source maps.
If you want to debug your tests or get stack traces from your tests processed with source maps, then run npm run compile-dev
followed by npm run test-dev
. The former will transpile your source and test code into the build/
directory,
with source maps (this is only needed if your src or test files change), and the latter will run the transpiled tests
in that directory.