|
3 | 3 | const expect = require('chai').use(require('chai-string')).expect; |
4 | 4 | const RSVP = require('rsvp'); |
5 | 5 | const request = RSVP.denodeify(require('request')); |
| 6 | +const setFastbootPkgPath = require('../lib/path/set-fastboot-pkg-path'); |
6 | 7 |
|
7 | 8 | const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp; |
8 | 9 |
|
9 | | -describe('FastBoot config', function () { |
| 10 | +describe('FastBoot config', function() { |
10 | 11 | this.timeout(400000); |
11 | 12 |
|
12 | 13 | let app; |
13 | 14 |
|
14 | | - before(function () { |
| 15 | + before(function() { |
15 | 16 | app = new AddonTestApp(); |
16 | 17 |
|
17 | 18 | return app |
18 | 19 | .create('fastboot-config', { |
19 | 20 | emberVersion: '~3.28.12', |
20 | | - emberDataVersion: '~3.28.12', |
| 21 | + emberDataVersion: '~3.28.12' |
21 | 22 | }) |
22 | | - .then(function () { |
23 | | - app.editPackageJSON((pkg) => { |
| 23 | + .then(function() { |
| 24 | + app.editPackageJSON(pkg => { |
| 25 | + setFastbootPkgPath(pkg); |
24 | 26 | delete pkg.devDependencies['ember-fetch']; |
25 | 27 | delete pkg.devDependencies['ember-welcome-page']; |
26 | 28 | // needed because @ember-data/store does `FastBoot.require('crypto')` |
27 | 29 | pkg.fastbootDependencies = ['node-fetch', 'crypto']; |
28 | 30 | }); |
29 | 31 | return app.run('npm', 'install'); |
30 | 32 | }) |
31 | | - .then(function () { |
| 33 | + .then(function() { |
32 | 34 | return app.startServer({ |
33 | | - command: 'serve', |
| 35 | + command: 'serve' |
34 | 36 | }); |
35 | 37 | }); |
36 | 38 | }); |
37 | 39 |
|
38 | | - after(function () { |
| 40 | + after(function() { |
39 | 41 | return app.stopServer(); |
40 | 42 | }); |
41 | 43 |
|
42 | | - it('provides sandbox globals', function () { |
| 44 | + it('provides sandbox globals', function() { |
43 | 45 | return request({ |
44 | 46 | url: 'http://localhost:49741/', |
45 | 47 | headers: { |
46 | | - Accept: 'text/html', |
47 | | - }, |
48 | | - }).then(function (response) { |
| 48 | + Accept: 'text/html' |
| 49 | + } |
| 50 | + }).then(function(response) { |
49 | 51 | expect(response.statusCode).to.equal(200); |
50 | 52 | expect(response.headers['content-type']).to.equalIgnoreCase( |
51 | 53 | 'text/html; charset=utf-8' |
|
0 commit comments