If you are trying to run your mocha tests by using mocha-webpack, you might end up with an ugly stack trace that points to some line number in a temporary file, which was created by mocha-webpack module. Unfortunately, when test execution completes, that temporary file is long gone and you are left with a big puzzle to solve.
Here's how you can generate that bundle.js
file that is referenced in the stack trace:
export PATH="$PATH:`pwd`/node_modules/.bin"
webpack --config webpack.config.test.js test/**/*.spec.ts saved.bundle.js
mocha-webpack --webpack-config webpack.config.test.js test/**/*.spec.ts
Now, when you get a stack trace, simply look at your saved.bundle.js
and see what is going on!