Skip to content

Commit c265d74

Browse files
committed
Handle comments in tsconfig in precompile tests
1 parent 7d490d3 commit c265d74

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

ts/tests/commands/precompile-test.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ describe('Acceptance: ts:precompile command', function () {
2727

2828
let declaration = file('test-file.d.ts');
2929
expect(declaration).to.exist;
30-
expect(declaration.content.trim()).to.equal(`export declare const testString: string;`);
30+
expect(declaration.content.trim()).to.equal(
31+
`export declare const testString: string;\n//# sourceMappingURL=test-file.d.ts.map`
32+
);
3133
});
3234

3335
it('generates nothing from the app tree', async () => {
@@ -65,15 +67,17 @@ describe('Acceptance: ts:precompile command', function () {
6567

6668
let pkg = fs.readJsonSync('package.json');
6769
let tsconfig = ts.readConfigFile('tsconfig.json', ts.sys.readFile).config;
68-
tsconfig.tsconfig.include.push('src');
70+
tsconfig.include.push('src');
6971
tsconfig.compilerOptions.paths[`${pkg.name}/src/*`] = ['src/*'];
7072
fs.writeJSONSync('tsconfig.json', tsconfig);
7173

7274
await ember(['ts:precompile']);
7375

7476
let declaration = file('src/test-file.d.ts');
7577
expect(declaration).to.exist;
76-
expect(declaration.content.trim()).to.equal(`export declare const testString: string;`);
78+
expect(declaration.content.trim()).to.equal(
79+
`export declare const testString: string;\n//# sourceMappingURL=test-file.d.ts.map`
80+
);
7781
});
7882
});
7983

@@ -95,7 +99,9 @@ describe('Acceptance: ts:precompile command', function () {
9599

96100
let declaration = file('test-file.d.ts');
97101
expect(declaration).to.exist;
98-
expect(declaration.content.trim()).to.equal(`export declare const testString: string;`);
102+
expect(declaration.content.trim()).to.equal(
103+
`export declare const testString: string;\n//# sourceMappingURL=test-file.d.ts.map`
104+
);
99105
});
100106
});
101107

@@ -121,7 +127,9 @@ describe('Acceptance: ts:precompile command', function () {
121127
return ember(['ts:precompile']).then(() => {
122128
const declaration = file('test-support/test-file.d.ts');
123129
expect(declaration).to.exist;
124-
expect(declaration.content.trim()).to.equal(`export declare const testString: string;`);
130+
expect(declaration.content.trim()).to.equal(
131+
`export declare const testString: string;\n//# sourceMappingURL=test-file.d.ts.map`
132+
);
125133
});
126134
});
127135

@@ -155,12 +163,14 @@ describe('Acceptance: ts:precompile command', function () {
155163
return ember(['ts:precompile']).then(() => {
156164
const componentDecl = file('components/my-component.d.ts');
157165
expect(componentDecl).to.exist;
158-
expect(componentDecl.content.trim()).to.equal(`export declare const testString: string;`);
166+
expect(componentDecl.content.trim()).to.equal(
167+
`export declare const testString: string;\n//# sourceMappingURL=my-component.d.ts.map`
168+
);
159169

160170
const testSupportDecl = file('test-support/test-file.d.ts');
161171
expect(testSupportDecl).to.exist;
162172
expect(testSupportDecl.content.trim()).to.equal(
163-
`export declare const anotherTestString: string;`
173+
`export declare const anotherTestString: string;\n//# sourceMappingURL=test-file.d.ts.map`
164174
);
165175
});
166176
});

0 commit comments

Comments
 (0)