Skip to content

Commit 111bcfb

Browse files
authored
Merge pull request #247 from NativeScript/fatme/fix-tsconfig.spec.json
fix: extends correctly tsconfig.json from tsconfig.spec.json
2 parents 56cb8ba + fad9cdf commit 111bcfb

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
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/_files/tsconfig.spec.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
55
"module": "commonjs",
@@ -9,8 +9,8 @@
99
]
1010
},
1111
"files": [
12-
"test.ts",
13-
"polyfills.ts"
12+
"<%= sourcedir %>/test.ts",
13+
"<%= sourcedir %>/polyfills.ts"
1414
],
1515
"include": [
1616
"**/*.spec.ts",

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)