Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: set env var TS_JEST to allow detecting of ts-jest (#2717)
Closes #2716
  • Loading branch information
B4nan committed Jul 3, 2021
1 parent dbbe45d commit 56c137a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ts-jest-transformer.spec.ts
Expand Up @@ -352,6 +352,10 @@ Array [
`)
})

test('should allow detection of ts-jest', () => {
expect(process.env.TS_JEST).toBe('1')
})

test.each(['foo.ts', 'foo.tsx'])('should process ts/tsx file', (filePath) => {
const fileContent = 'const foo = 1'
const output = 'var foo = 1'
Expand Down
1 change: 1 addition & 0 deletions src/ts-jest-transformer.ts
Expand Up @@ -63,6 +63,7 @@ export class TsJestTransformer implements SyncTransformer {
this.process = this.process.bind(this)

this._logger.debug('created new transformer')
process.env.TS_JEST = '1'
}

private _configsFor(transformOptions: TransformOptionsTsJest): ConfigSet {
Expand Down

0 comments on commit 56c137a

Please sign in to comment.