jest-runner-tsc icon indicating copy to clipboard operation
jest-runner-tsc copied to clipboard

What is the benefit to use jest-runner-tsc?

Open VusalIs opened this issue 4 years ago • 1 comments

I convert test files from flow javascript to typescript. I saw that in the application, I use jest-runner, but in the documentation of jest, there is also jest-runner-tsc. I try to understand the difference between them and what kind of benefit I will get if I use jest-runner-tsc? Additionally, I converted some test files to typescript and it works fine with jest-runner.

VusalIs avatar Mar 31 '21 19:03 VusalIs

jest-runner-tsc doesn't run tests. It runs the tsc (typescript compiler) on the typescript files. Doin so, you can check / build your application with the tsc.

If you also want to run tests on your code base, you have to create two entry points for jest:

  • jest.config.js // runs your tests with jest
  • jest.tsc.config.js // runs tsc on your ts files -> call it with jest -c ./jest.tsc.config.js

stixx200 avatar Jun 18 '21 06:06 stixx200