🐛 Bug Report
I'm writing a npm package in Typescript and in this project I use some third party library that is written in js. Since I need this js file to be in the build folder in the end of build process(and also for an easier development process), I set "allowJs" to be true in my tsconfig.json.
I use jest for my tests and my preset is ts-jest. When I run my tests I get the following error:
TypeError: tests\test123.test.ts: Emit skipped for language service
at compileFn (node_modules/ts-jest/dist/compiler/language-service.js:269:23)
But if I change allowJS to false, everything works fine.
I thought the problem might be in the third party library or in my project but I was able to reproduce the error on a clean project here
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/ilankhirin/ts-jest-issue.git
*npm i
*npm run test
You should get an error
*Change allowJS to false in tsconfig.json
*Re-run "npm run test"
No problem
Expected behavior
I expect the tests to pass with allowJS set to true.
Link to repo (highly encouraged)
https://github.com/ilankhirin/ts-jest-issue
Debug log:
# content of ts-jest.log :
https://github.com/ilankhirin/ts-jest-issue/blob/main/ts-jest.log
envinfo
System:
OS: Windows 10
Node version: 12.18.4
Npm packages:
jest: 26.6.3
ts-jest: 26.5.1
typescript: 4.1.5
babel(optional): no babel
🐛 Bug Report
I'm writing a npm package in Typescript and in this project I use some third party library that is written in js. Since I need this js file to be in the build folder in the end of build process(and also for an easier development process), I set "allowJs" to be true in my tsconfig.json.
I use jest for my tests and my preset is ts-jest. When I run my tests I get the following error:
But if I change allowJS to false, everything works fine.
I thought the problem might be in the third party library or in my project but I was able to reproduce the error on a clean project here
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/ilankhirin/ts-jest-issue.git
*npm i
*npm run test
You should get an error
*Change allowJS to false in tsconfig.json
*Re-run "npm run test"
No problem
Expected behavior
I expect the tests to pass with allowJS set to true.
Link to repo (highly encouraged)
https://github.com/ilankhirin/ts-jest-issue
Debug log:
https://github.com/ilankhirin/ts-jest-issue/blob/main/ts-jest.log
envinfo