Should /dist/ be included in jest tests?

Viewed 367

I have a React typescript project where I have foo.test.ts alongside foo.ts within a /src/ directory that is built into a /dist/ directory. By default, typescript compiles foo.test.ts to foo.test.js within the /dist/ directory. When I run tests with Jest, it will test on the /src/ Typescript test as well as the /dist/ JavaScript version. Is there a reason to not exclude *.test.ts from tsconfig.json so that only one copy of the test exists - the /src/ one? Or inversely, should the Jest (somehow) ignore the /src/ version and only run tests on the /dist/ version?

0 Answers
Related