fix(schematics): exclude jest setup file in tsconfig.app.json
This commit is contained in:
parent
9714a97f3c
commit
4bd39e7f85
@ -303,6 +303,17 @@ describe('app', () => {
|
||||
'apps/my-app/tsconfig.app.json',
|
||||
'apps/my-app/tsconfig.spec.json'
|
||||
]);
|
||||
const tsconfigAppJson = readJsonInTree(
|
||||
tree,
|
||||
'apps/my-app/tsconfig.app.json'
|
||||
);
|
||||
expect(tsconfigAppJson.exclude).toEqual([
|
||||
'src/test-setup.ts',
|
||||
'**/*.spec.ts'
|
||||
]);
|
||||
expect(tsconfigAppJson.compilerOptions.outDir).toEqual(
|
||||
'../../dist/out-tsc/apps/my-app'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -175,7 +175,6 @@ function updateProject(options: NormalizedSchema): Rule {
|
||||
return json;
|
||||
}),
|
||||
updateJsonInTree(`${options.appProjectRoot}/tsconfig.app.json`, json => {
|
||||
json.exclude = json.exclude || [];
|
||||
return {
|
||||
...json,
|
||||
extends: `${offsetFromRoot(options.appProjectRoot)}tsconfig.json`,
|
||||
@ -185,6 +184,10 @@ function updateProject(options: NormalizedSchema): Rule {
|
||||
options.appProjectRoot
|
||||
}`
|
||||
},
|
||||
exclude:
|
||||
options.unitTestRunner === 'jest'
|
||||
? ['src/test-setup.ts', '**/*.spec.ts']
|
||||
: json.exclude || [],
|
||||
include: ['**/*.ts']
|
||||
};
|
||||
}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user