Skip to content

Commit be9c27f

Browse files
committed
Stop assuming line endings in command tests
1 parent 36c6cba commit be9c27f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

node-tests/commands/clean-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ describe('Acceptance: ts:clean command', function() {
2222
fs.ensureDirSync('tmp');
2323
fs.ensureDirSync('app');
2424
fs.ensureDirSync('addon');
25-
fs.writeFileSync('app/test-file.ts', `export const testString: string = 'app';\n`);
26-
fs.writeFileSync('addon/test-file.ts', `export const testString: string = 'addon';\n`);
25+
fs.writeFileSync('app/test-file.ts', `export const testString: string = 'app';`);
26+
fs.writeFileSync('addon/test-file.ts', `export const testString: string = 'addon';`);
2727

2828
let before = walkSync(process.cwd());
2929
return ember(['ts:precompile'])

node-tests/commands/precompile-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@ describe('Acceptance: ts:precompile command', function() {
2020

2121
it('generates .js and .d.ts files from the addon tree', function() {
2222
fs.ensureDirSync('addon');
23-
fs.writeFileSync('addon/test-file.ts', `export const testString: string = 'hello';\n`);
23+
fs.writeFileSync('addon/test-file.ts', `export const testString: string = 'hello';`);
2424

2525
return ember(['ts:precompile'])
2626
.then(() => {
2727
let declaration = file('test-file.d.ts');
2828
expect(declaration).to.exist;
29-
expect(declaration.content).to.equal(`export declare const testString: string;\n`);
29+
expect(declaration.content.trim()).to.equal(`export declare const testString: string;`);
3030

3131
let transpiled = file('addon/test-file.js');
3232
expect(transpiled).to.exist;
33-
expect(transpiled.content).to.equal(`export const testString = 'hello';\n`);
33+
expect(transpiled.content.trim()).to.equal(`export const testString = 'hello';`);
3434
});
3535
});
3636

3737
it('generates .js files only from the app tree', function() {
3838
fs.ensureDirSync('app');
39-
fs.writeFileSync('app/test-file.ts', `export const testString: string = 'hello';\n`);
39+
fs.writeFileSync('app/test-file.ts', `export const testString: string = 'hello';`);
4040

4141
return ember(['ts:precompile']).then(() => {
4242
let declaration = file('test-file.d.ts');
4343
expect(declaration).not.to.exist;
4444

4545
let transpiled = file('app/test-file.js');
4646
expect(transpiled).to.exist;
47-
expect(transpiled.content.split('\n')[0]).to.equal(`export const testString = 'hello';`);
47+
expect(transpiled.content.trim()).to.equal(`export const testString = 'hello';`);
4848
});
4949
});
5050
});

0 commit comments

Comments
 (0)