Configure jest to automatically pick changes in typescript modules without need to compile them using tsc

Summary: Right now, if you are changing something in one of the modules, e.g. in "flipper-plugin", you'll need to compile the changed module using `tsc` before running tests, otherwise `jest` won't pick up the changes. `yarn test` has a step to run `tsc` before tests, however when tests are started simply by `jest` command, e.g. by VSCode plugin, then `tsc` is not automatically called before tests. This diff makes things easier by configuring `jest` to automatically transpile imported modules. This means simply running `jest` command will automatically pick up and automatically transpile all the changes.

Reviewed By: passy

Differential Revision: D28310318

fbshipit-source-id: 77e9b91daa59a46ce64b1b70eb9a998d7b72de00
This commit is contained in:
Anton Nikolaev
2021-05-11 17:02:24 -07:00
committed by Facebook GitHub Bot
parent 28fd8da615
commit 32f276b499
2 changed files with 24 additions and 0 deletions

View File

@@ -22,4 +22,5 @@ module.exports = {
coverageReporters: ['json-summary', 'lcov', 'html'],
testMatch: ['**/**.(node|spec).(js|jsx|ts|tsx)'],
testEnvironment: 'jest-environment-jsdom-sixteen',
resolver: '<rootDir>/jest.resolver.js',
};