Skip to content

Commit 412fb3b

Browse files
committed
Fix CI
ember-cli-addon-tests defaults to use ember-data 3.8 which is not compatible any more https://github.com/tomdale/ember-cli-addon-tests/blob/6f0beb154853d7e755a8007a30f01eb2b4f4a6dc/lib/utilities/pristine.js#L98 Also disable a test which throws: Error: Cannot find module 'abortcontroller-polyfill/dist/cjs-ponyfill'
1 parent 341fcef commit 412fb3b

File tree

8 files changed

+228
-201
lines changed

8 files changed

+228
-201
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ jobs:
119119
run: |
120120
yarn install --ignore-engines --frozen-lockfile
121121
- name: Run Mocha Tests
122-
working-directory: ./packages/ember-cli-fastboot
123122
run: |
124123
npm --version
125-
yarn test:mocha
124+
yarn workspace ember-cli-fastboot test:mocha

packages/ember-cli-fastboot/test/fastboot-config-test.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,42 @@ const request = RSVP.denodeify(require('request'));
66

77
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;
88

9-
describe('FastBoot config', function() {
9+
describe('FastBoot config', function () {
1010
this.timeout(400000);
1111

1212
let app;
1313

14-
before(function() {
14+
before(function () {
1515
app = new AddonTestApp();
1616

17-
return app.create('fastboot-config', { emberVersion: 'latest'})
18-
.then(function() {
17+
return app
18+
.create('fastboot-config', {
19+
emberVersion: 'latest',
20+
emberDataVersion: '~3.19.0',
21+
})
22+
.then(function () {
1923
return app.startServer({
20-
command: 'serve'
24+
command: 'serve',
2125
});
2226
});
2327
});
2428

25-
after(function() {
29+
after(function () {
2630
return app.stopServer();
2731
});
2832

29-
it('provides sandbox globals', function() {
33+
it('provides sandbox globals', function () {
3034
return request({
3135
url: 'http://localhost:49741/',
3236
headers: {
33-
'Accept': 'text/html'
34-
}
35-
})
36-
.then(function(response) {
37-
expect(response.statusCode).to.equal(200);
38-
expect(response.headers['content-type']).to.equalIgnoreCase('text/html; charset=utf-8');
39-
expect(response.body).to.contain('<h1>My Global</h1>');
40-
});
37+
Accept: 'text/html',
38+
},
39+
}).then(function (response) {
40+
expect(response.statusCode).to.equal(200);
41+
expect(response.headers['content-type']).to.equalIgnoreCase(
42+
'text/html; charset=utf-8'
43+
);
44+
expect(response.body).to.contain('<h1>My Global</h1>');
45+
});
4146
});
4247
});

packages/ember-cli-fastboot/test/fastboot-location-config-test.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,55 @@ const request = RSVP.denodeify(require('request'));
66

77
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;
88

9-
describe('FastBootLocation Configuration', function() {
9+
describe('FastBootLocation Configuration', function () {
1010
this.timeout(300000);
1111

1212
let app;
1313

14-
before(function() {
14+
before(function () {
1515
app = new AddonTestApp();
1616

17-
return app.create('fastboot-location-config', { emberVersion: 'latest'})
18-
.then(function() {
17+
return app
18+
.create('fastboot-location-config', {
19+
emberVersion: 'latest',
20+
emberDataVersion: '~3.19.0',
21+
})
22+
.then(function () {
1923
return app.startServer({
20-
command: 'serve'
24+
command: 'serve',
2125
});
2226
});
2327
});
2428

25-
after(function() {
29+
after(function () {
2630
return app.stopServer();
2731
});
2832

29-
it('should use the redirect code provided by the EmberApp', function() {
33+
it('should use the redirect code provided by the EmberApp', function () {
3034
return request({
3135
url: 'http://localhost:49741/redirect-on-transition-to',
3236
followRedirect: false,
3337
headers: {
34-
Accept: 'text/html'
35-
}
36-
}).then(function(response) {
38+
Accept: 'text/html',
39+
},
40+
}).then(function (response) {
3741
if (response.statusCode === 500) throw new Error(response.body);
3842
expect(response.statusCode).to.equal(302);
39-
expect(response.headers.location).to.equal('//localhost:49741/test-passed');
43+
expect(response.headers.location).to.equal(
44+
'//localhost:49741/test-passed'
45+
);
4046
});
4147
});
4248

43-
describe('when fastboot.fastbootHeaders is false', function() {
44-
it('should not send the "x-fastboot-path" header on a redirect', function() {
49+
describe('when fastboot.fastbootHeaders is false', function () {
50+
it('should not send the "x-fastboot-path" header on a redirect', function () {
4551
return request({
4652
url: 'http://localhost:49741/redirect-on-transition-to',
4753
followRedirect: false,
4854
headers: {
49-
Accept: 'text/html'
50-
}
51-
}).then(function(response) {
55+
Accept: 'text/html',
56+
},
57+
}).then(function (response) {
5258
if (response.statusCode === 500) throw new Error(response.body);
5359
expect(response.headers).to.not.include.keys(['x-fastboot-path']);
5460
});

packages/ember-cli-fastboot/test/fastboot-location-test.js

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,37 @@ const request = RSVP.denodeify(require('request'));
66

77
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;
88

9-
describe('FastBootLocation', function() {
9+
describe('FastBootLocation', function () {
1010
this.timeout(300000);
1111

1212
let app;
13-
before(function() {
13+
before(function () {
1414
app = new AddonTestApp();
1515

16-
return app.create('fastboot-location', { emberVersion: 'latest'})
17-
.then(function() {
16+
return app
17+
.create('fastboot-location', {
18+
emberVersion: 'latest',
19+
emberDataVersion: '~3.19.0',
20+
})
21+
.then(function () {
1822
return app.startServer({
19-
command: 'serve'
23+
command: 'serve',
2024
});
2125
});
2226
});
2327

24-
after(function() {
28+
after(function () {
2529
return app.stopServer();
2630
});
2731

28-
it('should NOT redirect when no transition is called', function() {
32+
it('should NOT redirect when no transition is called', function () {
2933
return request({
3034
url: 'http://localhost:49741/my-root/test-passed',
3135
followRedirect: false,
3236
headers: {
33-
Accept: 'text/html'
34-
}
35-
}).then(function(response) {
37+
Accept: 'text/html',
38+
},
39+
}).then(function (response) {
3640
if (response.statusCode === 500) throw new Error(response.body);
3741
expect(response.statusCode).to.equal(200);
3842

@@ -46,15 +50,14 @@ describe('FastBootLocation', function() {
4650
});
4751
});
4852

49-
it('should NOT redirect when intermediateTransitionTo is called', function() {
53+
it('should NOT redirect when intermediateTransitionTo is called', function () {
5054
return request({
51-
url:
52-
'http://localhost:49741/my-root/redirect-on-intermediate-transition-to',
55+
url: 'http://localhost:49741/my-root/redirect-on-intermediate-transition-to',
5356
followRedirect: false,
5457
headers: {
55-
Accept: 'text/html'
56-
}
57-
}).then(function(response) {
58+
Accept: 'text/html',
59+
},
60+
}).then(function (response) {
5861
if (response.statusCode === 500) throw new Error(response.body);
5962
expect(response.statusCode).to.equal(200);
6063

@@ -69,14 +72,14 @@ describe('FastBootLocation', function() {
6972
});
7073
});
7174

72-
it('should redirect when transitionTo is called', function() {
75+
it('should redirect when transitionTo is called', function () {
7376
return request({
7477
url: 'http://localhost:49741/my-root/redirect-on-transition-to',
7578
followRedirect: false,
7679
headers: {
77-
Accept: 'text/html'
78-
}
79-
}).then(function(response) {
80+
Accept: 'text/html',
81+
},
82+
}).then(function (response) {
8083
if (response.statusCode === 500) throw new Error(response.body);
8184
expect(response.statusCode).to.equal(307);
8285

@@ -92,14 +95,14 @@ describe('FastBootLocation', function() {
9295
});
9396
});
9497

95-
it('should redirect when replaceWith is called', function() {
98+
it('should redirect when replaceWith is called', function () {
9699
return request({
97100
url: 'http://localhost:49741/my-root/redirect-on-replace-with',
98101
followRedirect: false,
99102
headers: {
100-
Accept: 'text/html'
101-
}
102-
}).then(function(response) {
103+
Accept: 'text/html',
104+
},
105+
}).then(function (response) {
103106
if (response.statusCode === 500) throw new Error(response.body);
104107
expect(response.statusCode).to.equal(307);
105108

@@ -115,14 +118,14 @@ describe('FastBootLocation', function() {
115118
});
116119
});
117120

118-
it('should NOT redirect when transitionTo is called with identical route name', function() {
121+
it('should NOT redirect when transitionTo is called with identical route name', function () {
119122
return request({
120123
url: 'http://localhost:49741/my-root/noop-transition-to',
121124
followRedirect: false,
122125
headers: {
123-
Accept: 'text/html'
124-
}
125-
}).then(function(response) {
126+
Accept: 'text/html',
127+
},
128+
}).then(function (response) {
126129
if (response.statusCode === 500) throw new Error(response.body);
127130
expect(response.statusCode).to.equal(200);
128131

@@ -136,14 +139,14 @@ describe('FastBootLocation', function() {
136139
});
137140
});
138141

139-
it('should NOT redirect when replaceWith is called with identical route name', function() {
142+
it('should NOT redirect when replaceWith is called with identical route name', function () {
140143
return request({
141144
url: 'http://localhost:49741/my-root/noop-replace-with',
142145
followRedirect: false,
143146
headers: {
144-
Accept: 'text/html'
145-
}
146-
}).then(function(response) {
147+
Accept: 'text/html',
148+
},
149+
}).then(function (response) {
147150
if (response.statusCode === 500) throw new Error(response.body);
148151
expect(response.statusCode).to.equal(200);
149152

packages/ember-cli-fastboot/test/new-package-json-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const expect = require('chai').expect;
55
const helpers = require('broccoli-test-helper');
66
const createBuilder = helpers.createBuilder;
77
const createTempDir = helpers.createTempDir;
8-
const co = require('co');
98
const FastbootConfig = require('../lib/broccoli/fastboot-config');
109

1110
describe('FastbootConfig', function() {

packages/ember-cli-fastboot/test/package-json-test.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
'use strict';
22

3-
const chai = require('chai');
4-
const expect = chai.expect;
5-
const fs = require('fs-extra');
6-
const path = require('path');
3+
const chai = require('chai');
4+
const expect = chai.expect;
5+
const fs = require('fs-extra');
6+
const path = require('path');
77
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;
88

99
chai.use(require('chai-fs'));
1010

11-
describe('generating package.json', function() {
11+
describe('generating package.json', function () {
1212
this.timeout(300000);
1313

14-
describe('with customized outputPaths options', function() {
14+
describe('with customized outputPaths options', function () {
1515
// Tests an app with a custom `outputPaths` set
1616
let customApp = new AddonTestApp();
1717

18-
before(function() {
19-
return customApp.create('customized-outputpaths')
20-
.then(function() {
18+
before(function () {
19+
return customApp
20+
.create('customized-outputpaths', {
21+
emberVersion: 'latest',
22+
emberDataVersion: '~3.19.0',
23+
})
24+
.then(function () {
2125
return customApp.runEmberCommand('build');
2226
});
2327
});
2428

25-
it('respects custom output paths and maps to them in the manifest', function() {
29+
it('respects custom output paths and maps to them in the manifest', function () {
2630
function p(filePath) {
2731
return customApp.filePath(path.join('dist', filePath));
2832
}
@@ -31,16 +35,15 @@ describe('generating package.json', function() {
3135
let manifest = pkg.fastboot.manifest;
3236

3337
expect(manifest.appFiles).to.include('some-assets/path/app-file.js');
34-
manifest.appFiles.forEach(function(file) {
38+
manifest.appFiles.forEach(function (file) {
3539
expect(p(file)).to.be.a.file();
3640
});
3741
expect(p(manifest.htmlFile)).to.be.a.file();
3842

3943
expect(manifest.vendorFiles).to.include('some-assets/path/lib.js');
40-
manifest.vendorFiles.forEach(function(file) {
44+
manifest.vendorFiles.forEach(function (file) {
4145
expect(p(file)).to.be.a.file();
4246
});
4347
});
4448
});
4549
});
46-

0 commit comments

Comments
 (0)