Registry / testing / jest-runner-tsc

jest-runner-tsc

JSON →
library1.6.0jsnpmunverified

A Jest runner for the TypeScript compiler that allows running type checking as part of the Jest test suite. Version 1.6.0 (latest, 2019) uses transpileModule for faster builds and supports custom tsconfig paths. No significant updates since 2019; library is in maintenance mode. Differentiators: integrates TypeScript compilation directly into Jest's runner pipeline, provides type errors as test failures, and supports project references via tsconfig. Alternatives: ts-jest for combined compilation and testing, or a separate tsc --noEmit step.

npm install jest-runner-tsc
INSTALL
IMPORT
SIG · JEST-RUNNER-TSC
J
jest-runner-tsc
testingjavascriptv1.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jest-runner-tsc
module.exports = { runner: 'jest-runner-tsc', ... }
const runner = require('jest-runner-tsc')
This package is a Jest runner, not a library. It is configured via Jest's runner option, not imported directly.

Configuration example showing how to use jest-runner-tsc as a Jest runner, including optional tsconfig path setting.

// jest.tsc.config.js module.exports = { runner: 'jest-runner-tsc', displayName: 'tsc', moduleFileExtensions: ['ts', 'tsx', 'js'], testMatch: ['<rootDir>/**/*.ts'], // Optional: specify tsconfig path // transform: { '^.+\\.tsx?$': 'ts-jest' }, // Not needed // globalSetup: undefined, // ... other Jest config }; // package.json { "jest-runner-tsc": { "tsconfigPath": "./tsconfig.json" } } // Run with: jest -c jest.tsc.config.js
Debug
Known issues
gotchaThis runner only type-checks files matching testMatch. If your tsconfig includes other files, they won't be checked unless included in testMatch.
fix
Ensure your testMatch glob covers all TypeScript files you want to type-check, or use tsconfig's include/files.
affects: >=1.0.0
deprecatedPackage has not been updated since 2019. It may not work with newer Jest versions (>=27) due to changes in Jest runner API.
fix
Consider using ts-jest with isolatedModules or separate tsc --noEmit step.
affects: >=1.6.0
gotchaBy default, tsconfig.json is resolved relative to the Jest rootDir (usually the project root), but you can override with tsconfigPath option.
fix
If your tsconfig is not in rootDir, set 'tsconfigPath' in jest-runner-tsc config.
affects: >=1.0.0
gotchaThe runner uses transpileModule, so it does not output any files. It only reports type errors.
fix
Do not expect any compiled output; use a separate build step.
affects: >=1.5.0
Errors
Common errors & fixes
TypeError: Jest: Got error running runner: Cannot find module 'jest-runner-tsc'
jest-runner-tsc is not installed or not in Jest's module resolution path.
fix
Install jest-runner-tsc as devDependency and ensure Jest can resolve it (check working directory).
Configuration error: Unknown option 'displayName'
Using Jest version < 24 where displayName was not supported.
fix
Remove displayName or upgrade Jest to >=24.
Cannot find module 'typescript'
TypeScript is not installed or not in node_modules.
fix
Install TypeScript: npm install --save-dev typescript
Upgrade
Version history
1.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
jest-runner-tsc — npm install jest-runner-tsc · libregistry