Skip to content

Commit 56c137a

Browse files
authoredJul 3, 2021
feat: set env var TS_JEST to allow detecting of ts-jest (#2717)
Closes #2716
1 parent dbbe45d commit 56c137a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎src/ts-jest-transformer.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ Array [
352352
`)
353353
})
354354

355+
test('should allow detection of ts-jest', () => {
356+
expect(process.env.TS_JEST).toBe('1')
357+
})
358+
355359
test.each(['foo.ts', 'foo.tsx'])('should process ts/tsx file', (filePath) => {
356360
const fileContent = 'const foo = 1'
357361
const output = 'var foo = 1'

‎src/ts-jest-transformer.ts

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export class TsJestTransformer implements SyncTransformer {
6363
this.process = this.process.bind(this)
6464

6565
this._logger.debug('created new transformer')
66+
process.env.TS_JEST = '1'
6667
}
6768

6869
private _configsFor(transformOptions: TransformOptionsTsJest): ConfigSet {

0 commit comments

Comments
 (0)
Please sign in to comment.