-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Description
Bug Report Checklist
- I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faqlabel, but none matched my issue. - I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
- I want to provide a PR to resolve this
Expected
When i have TS error in a module included in a test, it should show the TS error
Actual
When there is a TS error it shows "Cannot find module".
Minimal, Reproducible Example
I have what i think is a pretty simple typescript setup but at some point the compilation error handling has started causing a very hard to debug "Cannot find module", error rather than the TS error.
This is a stripped down repo which still exhibits the issue:
https://github.com/sam-super/mocha-ts-node-bug
Versions
[email protected]
[email protected]
Additional Info
E.g. from the reference example repo:
npm run test -- test/included-module-ts-error.test.ts
Exception during run: Error: Cannot find module '[...]/test/helpers/bad-module' imported from [...]/test/included-module-ts-error.test.ts
Possibly related issue is it manages to execute a test with a TS error in the top-level test file/suite without complaint:
npm run test -- test/top-level-compilation.test.ts
should error with ts error
✔ but passes when it should have failed
Metadata
Metadata
Assignees
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer