So, I have a project with typescript and requirejs. Typescript module output is set to amd syntax.
Tests also written in typescript with mocha and chai libraries. But when I'm trying to run selected test through 'Quick test launch', by pressing play button left to the test, I get an error:
ReferenceError: define is not defined
As far as I know, ts-node trying to compile file with options from tsconfig, and mocha doesn't work with amd syntax. If I comment line with "module": "amd" in my tsconfig, everything works great. I've found a solution to override this directive when running test, by creating 'Run/Debug Configuration' with environment variable
That only works for configuration I've created manually. And I would like to run or debug certain tests by pressing 'Quick test launch' with this evn. variable.
When I press 'Quick test launch' WebStrom generating run configuration something like this:
"C:\Program Files\nodejs\node.exe" --inspect-brk=53754 <project dir>/node_modules\mocha\bin\_mocha --require ts-node/register --timeout 0 --ui tdd --reporter "C:\Program Files\JetBrains\WebStorm 2017.1.4\plugins\NodeJS\js\mocha-intellij\lib\mochaIntellijReporter.js" <project dir>\tests\FailTest.ts --grep "Fail test test should fail$"
Is it possible to setup generating 'Quick test lauch' command or to use env. parameter or something else to configure it?