Skip to content

Commit fad9cdf

Browse files
committed
test: add unit tests that tsconfig.spec.json will be created with the correct files
1 parent 32e4462 commit fad9cdf

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/add-ns/index_spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ describe('Add {N} schematic', () => {
148148
expect(maps).toContain('src/*.ts');
149149
});
150150

151+
it('should create the tsconfig.spec.json (web) with files', () => {
152+
const specTsConfigPath = '/tsconfig.spec.json';
153+
expect(appTree.files).toContain(specTsConfigPath);
154+
155+
const specTsConfig = JSON.parse(getFileContent(appTree, specTsConfigPath));
156+
const files = specTsConfig.files;
157+
158+
expect(files).toBeDefined();
159+
expect(files.includes('src/test.ts')).toBeTruthy();
160+
expect(files.includes('src/polyfills.ts')).toBeTruthy();
161+
});
162+
151163
it('should modify the base tsconfig.json to include path mappings', () => {
152164
const baseTsConfigPath = '/tsconfig.json';
153165
expect(appTree.files).toContain(baseTsConfigPath);

src/ng-new/shared/index_spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('Shared Application Schematic', () => {
2727
expect(files).toContain('/foo/.gitignore');
2828
expect(files).toContain('/foo/package.json');
2929
expect(files).toContain('/foo/tsconfig.tns.json');
30+
expect(files).toContain('/foo/tsconfig.spec.json');
3031

3132
expect(files).toContain('/foo/src/package.json');
3233
expect(files).toContain('/foo/src/main.tns.ts');

0 commit comments

Comments
 (0)