Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@schematics/angular): remove reference to tsconfig.spec.json in tsconfig.json when minimal=true #18293

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/schematics/angular/application/index.ts
Expand Up @@ -383,7 +383,7 @@ export default function (options: ApplicationOptions): Rule {
]), MergeStrategy.Overwrite),
addTsConfigProjectReferences([
join(appDir, 'tsconfig.app.json'),
join(appDir, 'tsconfig.spec.json'),
... options.minimal ? [] : [join(appDir, 'tsconfig.spec.json')],
]),
options.minimal ? noop() : schematic('e2e', e2eOptions),
options.skipPackageJson ? noop() : addDependenciesToPackageJson(options),
Expand Down
11 changes: 11 additions & 0 deletions packages/schematics/angular/application/index_spec.ts
Expand Up @@ -91,6 +91,17 @@ describe('Application Schematic', () => {
]);
});

it('minimal=true should add correct reference in tsconfig', async () => {
const options = { ...defaultOptions, minimal: true };
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
.toPromise();

const { references } = readJsonFile(tree, '/tsconfig.json');
expect(references).toEqual([
{ path: './projects/foo/tsconfig.app.json' },
]);
});

it('should set the prefix to app if none is set', async () => {
const options = { ...defaultOptions };

Expand Down