Skip to content

Commit

Permalink
fix(testing): merge rather than replace ts-jest property on global …
Browse files Browse the repository at this point in the history
…config

resolves #1059
  • Loading branch information
Jon Rista committed Sep 29, 2019
1 parent 579a155 commit 995ffeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/jest/src/builders/jest/jest.impl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ describe('Jest Builder', () => {
beforeAll(() => {
jest.doMock(
'/root/jest.config.js',
() => ({ globals: { hereToStay: true } }),
() => ({ globals: { hereToStay: true, 'ts-jest': { diagnostics: false } } }),
{ virtual: true }
);
});
Expand All @@ -296,6 +296,7 @@ describe('Jest Builder', () => {
globals: JSON.stringify({
hereToStay: true,
'ts-jest': {
diagnostics: false,
tsConfig: '/root/tsconfig.test.json',
stringifyContentPathRegex: '\\.(html|svg)$',
astTransformers: [
Expand Down
5 changes: 4 additions & 1 deletion packages/jest/src/builders/jest/jest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ function run(
const jestConfig: { globals: any } = require(options.jestConfig);
const globals = jestConfig.globals || {};
Object.assign(globals, {
'ts-jest': tsJestConfig
'ts-jest': {
...(globals['ts-jest'] || {}),
...tsJestConfig
}
});

const config: any = {
Expand Down

0 comments on commit 995ffeb

Please sign in to comment.