Skip to content

Commit c427fea

Browse files
authored
fix(config): define matchTestFilePath before setupTsJestCfg (#2373)
Closes #2371
1 parent f2808bb commit c427fea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/__mocks__/dummy-transformer.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const { LogContexts, LogLevels } = require('bs-logger')
33
function factory(cs) {
44
const logger = cs.logger.child({ namespace: 'dummy-transformer' })
55
const ts = cs.compilerModule
6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7+
const program = cs.tsCompiler.program
68

79
function createVisitor(_ctx, _) {
810
return (node) => node

src/config/config-set.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ export class ConfigSet {
190190
this.logger.debug({ compilerModule: this.compilerModule }, 'normalized compiler module config via ts-jest option')
191191

192192
this._backportJestCfg()
193-
this._setupTsJestCfg(options)
194-
this._resolveTsCacheDir()
195193
this._matchablePatterns = [...this._jestCfg.testMatch, ...this._jestCfg.testRegex].filter(
196194
(pattern) =>
197195
/**
@@ -206,6 +204,8 @@ export class ConfigSet {
206204
this._matchTestFilePath = globsToMatcher(
207205
this._matchablePatterns.filter((pattern: any) => typeof pattern === 'string') as string[],
208206
)
207+
this._setupTsJestCfg(options)
208+
this._resolveTsCacheDir()
209209
}
210210

211211
/**

0 commit comments

Comments
 (0)