Skip to content

Commit

Permalink
chore: fix the way ts-jest receives its config
Browse files Browse the repository at this point in the history
  • Loading branch information
divdavem committed Dec 1, 2022
1 parent c929c84 commit 20bc6b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions jest.config.js
Expand Up @@ -3,12 +3,10 @@ module.exports = {
coverageDirectory: 'coverage',
collectCoverageFrom: ['none'], // prevent instrumentation from jest
transform: {
'packages[\\/\\\\].*\\.ts$': '<rootDir>/packages/jestTransform.js',
},
globals: {
'ts-jest': {
tsconfig: 'packages/tsconfig.json',
},
'packages[\\/\\\\].*\\.ts$': [
'<rootDir>/packages/jestTransform.js',
{ tsconfig: 'packages/tsconfig.json' },
],
},
testRegex: 'packages[\\/\\\\].*\\.spec\\.ts$',
moduleFileExtensions: ['ts', 'js'],
Expand Down
4 changes: 2 additions & 2 deletions packages/jestTransform.js
Expand Up @@ -2,8 +2,8 @@ const { shouldInstrument, process: instrument } = require('./instrument');
const { createTransformer } = require('ts-jest').default;
const { normalize } = require('path');

exports.createTransformer = () => {
const tsJestTransformer = createTransformer();
exports.createTransformer = (...args) => {
const tsJestTransformer = createTransformer(...args);

return {
process(content, filename, jestConfig) {
Expand Down

0 comments on commit 20bc6b3

Please sign in to comment.