Skip to content

Commit 4bd39e7

Browse files
skydevervsavkin
authored andcommittedOct 4, 2018
fix(schematics): exclude jest setup file in tsconfig.app.json
1 parent 9714a97 commit 4bd39e7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

Diff for: ‎packages/schematics/src/collection/application/application.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,17 @@ describe('app', () => {
303303
'apps/my-app/tsconfig.app.json',
304304
'apps/my-app/tsconfig.spec.json'
305305
]);
306+
const tsconfigAppJson = readJsonInTree(
307+
tree,
308+
'apps/my-app/tsconfig.app.json'
309+
);
310+
expect(tsconfigAppJson.exclude).toEqual([
311+
'src/test-setup.ts',
312+
'**/*.spec.ts'
313+
]);
314+
expect(tsconfigAppJson.compilerOptions.outDir).toEqual(
315+
'../../dist/out-tsc/apps/my-app'
316+
);
306317
});
307318
});
308319

Diff for: ‎packages/schematics/src/collection/application/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ function updateProject(options: NormalizedSchema): Rule {
175175
return json;
176176
}),
177177
updateJsonInTree(`${options.appProjectRoot}/tsconfig.app.json`, json => {
178-
json.exclude = json.exclude || [];
179178
return {
180179
...json,
181180
extends: `${offsetFromRoot(options.appProjectRoot)}tsconfig.json`,
@@ -185,6 +184,10 @@ function updateProject(options: NormalizedSchema): Rule {
185184
options.appProjectRoot
186185
}`
187186
},
187+
exclude:
188+
options.unitTestRunner === 'jest'
189+
? ['src/test-setup.ts', '**/*.spec.ts']
190+
: json.exclude || [],
188191
include: ['**/*.ts']
189192
};
190193
}),

0 commit comments

Comments
 (0)
Please sign in to comment.