Open 0-sv opened 3 years ago
This seems to work:
"test:strict": "TS_NODE_PROJECT='./tsconfig.strict.json' NODE_ENV=test mocha -r ts-node/register --timeout 25000 -r ts-custom-error src/*.test.* --exit"
But it doesn't work with ts-mocha as I expect with the --project
flag:
"test:strict": "NODE_ENV=test ts-mocha -p ./tsconfig.strict.json --timeout 25000 -r ts-custom-error src/*.test.* --exit"
I also have access to some environment variables, listed here: https://github.com/TypeStrong/ts-node/tree/629525474fb548fddb7a90a48ab795a9199b1997#cli-and-programmatic-options. Does this also work for ts-mocha
?
Hey, I'm having a hard time understanding what the difference is between these two commands. Basically, I've configured two
tsconfig.json
files and I use the--project
parameter to import them separately.The performance is much better with
ts-mocha
, thank you for that. But I see differences in behaviour, and I'm having a hard time wrapping my head around it...package.json
:tsconfig.strict.json
:Scenario 1
npm run test
withstrict: true
: I get a lot of TS errors (this is expected)Scenario 2
npm run test
withstrict: false
: execution but worser performance than withts-mocha
Scenario 3
npm run test:strict
withstrict: true
: I get no TS errors and normal compilation, albeit fast performance (I expect a lot of TS errors, but don't get any)Scenario 4
npm run test:strict
withstrict: false
: I get no TS errors and normal compilation, albeit fast performance.