Skip to content

Commit 4715c39

Browse files
authored
Merge pull request #649 from typed-ember/drop-node-6
Drop support for node 6 (EOL)
2 parents 6b5ff10 + fb7f880 commit 4715c39

File tree

9 files changed

+426
-498
lines changed

9 files changed

+426
-498
lines changed

.eslintrc.js

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ module.exports = {
7070
},
7171
rules: {
7272
'node/no-unpublished-require': 'off',
73-
'node/no-unsupported-features/es-syntax': 'off',
7473
},
7574
},
7675

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
"ember-beta": true,
1616
"ember-canary": true,
1717
"ember-default": true
18-
}
18+
},
19+
"typescript.tsdk": "node_modules/typescript/lib"
1920
}

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@typed-ember/renovate-config": "1.2.1",
6060
"@types/chai": "4.1.7",
6161
"@types/chai-as-promised": "7.1.0",
62-
"@types/co": "4.6.1",
6362
"@types/console-ui": "2.2.0",
6463
"@types/core-object": "3.0.1",
6564
"@types/debug": "4.1.4",
@@ -134,7 +133,7 @@
134133
"hawk": "7"
135134
},
136135
"engines": {
137-
"node": "6.* || 8.* || >= 10.*"
136+
"node": "8.* || >= 10.*"
138137
},
139138
"ember-addon": {
140139
"configPath": "tests/dummy/config",

ts/tests/acceptance/build-test.ts

+42-55
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import co from 'co';
21
import SkeletonApp from '../helpers/skeleton-app';
32
import chai from 'ember-cli-blueprint-test-helpers/chai';
43
import * as esprima from 'esprima';
@@ -25,90 +24,78 @@ describe('Acceptance: build', function() {
2524
app.teardown();
2625
});
2726

28-
it(
29-
'builds and rebuilds files',
30-
co.wrap(function*() {
31-
app.writeFile(
32-
'app/app.ts',
33-
`
27+
it('builds and rebuilds files', async () => {
28+
app.writeFile(
29+
'app/app.ts',
30+
`
3431
export function add(a: number, b: number) {
3532
return a + b;
3633
}
3734
`
38-
);
35+
);
3936

40-
let server = app.serve();
37+
let server = app.serve();
4138

42-
yield server.waitForBuild();
39+
await server.waitForBuild();
4340

44-
expectModuleBody(
45-
app,
46-
'skeleton-app/app',
47-
`
41+
expectModuleBody(
42+
app,
43+
'skeleton-app/app',
44+
`
4845
_exports.add = add;
4946
function add(a, b) {
5047
return a + b;
5148
}
5249
`
53-
);
50+
);
5451

55-
app.writeFile(
56-
'app/app.ts',
57-
`
52+
app.writeFile(
53+
'app/app.ts',
54+
`
5855
export const foo: string = 'hello';
5956
`
60-
);
57+
);
6158

62-
yield server.waitForBuild();
59+
await server.waitForBuild();
6360

64-
expectModuleBody(
65-
app,
66-
'skeleton-app/app',
67-
`
61+
expectModuleBody(
62+
app,
63+
'skeleton-app/app',
64+
`
6865
_exports.foo = void 0;
6966
var foo = 'hello';
7067
_exports.foo = foo;
7168
`
72-
);
73-
})
74-
);
69+
);
70+
});
7571

76-
it(
77-
'fails the build when noEmitOnError is set and an error is emitted',
78-
co.wrap(function*() {
79-
app.writeFile('app/app.ts', `import { foo } from 'nonexistent';`);
72+
it('fails the build when noEmitOnError is set and an error is emitted', async () => {
73+
app.writeFile('app/app.ts', `import { foo } from 'nonexistent';`);
8074

81-
yield expect(app.build()).to.be.rejectedWith(`Cannot find module 'nonexistent'`);
82-
})
83-
);
75+
await expect(app.build()).to.be.rejectedWith(`Cannot find module 'nonexistent'`);
76+
});
8477

85-
it(
86-
'serves a type error page when the build has failed',
87-
co.wrap(function*() {
88-
app.writeFile('app/index.html', 'plain index');
89-
app.writeFile('app/app.ts', `import { foo } from 'nonexistent';`);
78+
it('serves a type error page when the build has failed', async () => {
79+
app.writeFile('app/index.html', 'plain index');
80+
app.writeFile('app/app.ts', `import { foo } from 'nonexistent';`);
9081

91-
let server = app.serve();
92-
let output = yield server.waitForOutput('Typechecking failed');
93-
let response = yield server.request('/');
82+
let server = app.serve();
83+
let output = await server.waitForOutput('Typechecking failed');
84+
let response = await server.request('/');
9485

95-
expect(output).to.include(`Cannot find module 'nonexistent'`);
96-
expect(response.body).to.include(`Cannot find module 'nonexistent'`);
97-
})
98-
);
86+
expect(output).to.include(`Cannot find module 'nonexistent'`);
87+
expect(response.body).to.include(`Cannot find module 'nonexistent'`);
88+
});
9989

100-
it(
101-
"doesn't block builds for file changes that don't result in a typecheck",
102-
co.wrap(function*() {
103-
let server = app.serve();
90+
it("doesn't block builds for file changes that don't result in a typecheck", async () => {
91+
let server = app.serve();
10492

105-
yield server.waitForBuild();
93+
await server.waitForBuild();
10694

107-
app.writeFile('app/some-template.hbs', '');
95+
app.writeFile('app/some-template.hbs', '');
10896

109-
yield server.waitForBuild();
110-
})
111-
);
97+
await server.waitForBuild();
98+
});
11299
});
113100

114101
function isExpressionStatement(stmt: Statement | ModuleDeclaration): stmt is ExpressionStatement {

0 commit comments

Comments
 (0)