A Jest runner for the TypeScript compiler
npm install --save-dev jest-runner-tsc
Jest configuration:
jest.tsc.config.js:
module.exports = {
runner: 'jest-runner-tsc',
displayName: 'tsc',
moduleFileExtensions: ['ts', 'tsx'],
testMatch: ['<rootDir>/**/*.ts'],
};
jest -c jest.tsc.config.js