Closed Nice-Makarand closed 7 months ago
Looks like ts-node
might be running TypeScript type checking as part of your unit tests. https://typestrong.org/ts-node/docs/options/#typechecking has more info around options in that area. This is probably an issue with how you're using ts-node
.
If you've spotted a bug in Mocha that you can reproduce without integrations, please do post back. But I'm going to close this for now as external. Thanks!
Bug Report Checklist
faq
label, but none matched my issue.Expected
Expecting typescript test cases to execute faster or at usual pace.
Actual
Only typescript Unit test cases are taking time to execute which is not the case with javascript unit test cases.
Minimal, Reproducible Example
Typescript test case
Javascript test case
The problem here is, actual test case execution time is similar, however, time taken after command
is too much, which is not the case in JS.
Versions
"mocha": "10.0.0", "typescript": "4.5.2" "ts-node": "10.4.0" "sinon": "11.1.2" "@types/mocha": "9.0.0" "@types/sinon": "10.0.14"
node version > 18
Additional Info
It has been observed that there is no problem with mocking. Because test case execution happens in no time, it is heavy loading before the execution that is bothering me. Average time taken to execute entire TS test cases is 3 min, in which 1 second goes for execution.