Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/config/config-set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ describe('typescript', () => {
})
})

it('should include default outDir $$ts-jest$$ when allowJs is enabled and no outDir from config', () => {
expect(get(void 0, { tsConfig: { allowJs: true } }).options.outDir).toBe('$$ts-jest$$')
})

it('should be able to read extends', () => {
const cs = createConfigSet({
tsJestConfig: { tsConfig: 'tsconfig.build.json' },
Expand Down
4 changes: 4 additions & 0 deletions src/config/config-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@ export class ConfigSet {
finalOptions.allowSyntheticDefaultImports = true
}
}
// Make sure when allowJs is enabled, outDir is set otherwise we run into error: Cannot write file ... because it would overwrite input
if (finalOptions.allowJs && !finalOptions.outDir) {
finalOptions.outDir = '$$ts-jest$$'
}

// ensure undefined are removed and other values are overridden
for (const key of Object.keys(forcedOptions)) {
Expand Down