We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am having a TypeScript project, with following jest.config.mjs:
jest.config.mjs
/** @type {import('ts-jest').JestConfigWithTsJest} */ export default { testEnvironment: 'node', detectOpenHandles: true, verbose: true, cache: true, bail: 1, rootDir: '.', roots: ['<rootDir>/'], testMatch: ['<rootDir>/src/_tests/**/*.(spec|test).ts'], testPathIgnorePatterns: ['<rootDir>/node_modules/'], collectCoverageFrom: ['<rootDir>/src/**/*.ts'], coverageDirectory: '<rootDir>/coverage/', coverageReporters: ['none'], reporters: [ 'default', [ 'jest-monocart-coverage', { reports: [['html'], ['cobertura'], ['console-details']], outputDir: './coverage', }, ], [ 'jest-junit', { outputDirectory: '<rootDir>/coverage/', outputName: 'junit.xml', suiteName: 'Tests', classNameTemplate: '{classname}', ancestorSeparator: ' > ', }, ], ], transform: { '^.+.tsx?$': ['ts-jest', {}], }, transformIgnorePatterns: ['node_modules'], moduleNameMapper: { '^@/(.*)$': '<rootDir>/src/$1', }, coverageProvider: 'v8', passWithNoTests: true, forceExit: true, };
When I am running the tests with jest --coverage, the file contents are compiled JS, not TS. How can I have them as actual TS content?
jest --coverage
Example:
coverageReporters: ['html']
The text was updated successfully, but these errors were encountered:
It seems that it failed to load sourcemap files. try debug to show error details
debug
[ 'jest-monocart-coverage', { reports: [['html'], ['cobertura'], ['console-details']], logging: "debug", outputDir: './coverage', }, ],
Or provide a minimal reproduction repo.
Sorry, something went wrong.
Thanks for pointing out the issue. Changing the following in tsconfig.json worked for me:
tsconfig.json
{ "compilerOptions": { ... - "sourceMap": false, - "inlineSourceMap": true, + "sourceMap": true, + "inlineSourceMap": false, ... }, "include": ["src/", "lib/"], "exclude": ["node_modules/", "build/"] }
No branches or pull requests
I am having a TypeScript project, with following
jest.config.mjs
:When I am running the tests with
jest --coverage
, the file contents are compiled JS, not TS.How can I have them as actual TS content?
Example:
coverageReporters: ['html']
:The text was updated successfully, but these errors were encountered: