-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from xg-wang/host
fix: throwing w/ fresh ember-cli-fastboot serve
- Loading branch information
Showing
4 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
'use strict'; | ||
const request = require('request'); | ||
const get = require('rsvp').denodeify(request); | ||
const chai = require('chai'); | ||
const expect = chai.expect; | ||
chai.use(require('chai-fs')); | ||
|
||
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp; | ||
|
||
describe('renders in fastboot build', function() { | ||
this.timeout(300000); | ||
|
||
let app; | ||
|
||
beforeEach(function() { | ||
app = new AddonTestApp(); | ||
|
||
return app | ||
.create('dummy', { skipNpm: true }) | ||
.then(app => | ||
app.editPackageJSON(pkg => { | ||
pkg.devDependencies['ember-cli-fastboot'] = '*'; | ||
// [email protected] has ember-fetch as dependency, we want to test | ||
pkg.devDependencies['ember-fetch-adapter'] = '0.4.0'; | ||
// These 2 are in ember-fetch's package.json, symlinking to dummy won't help resolve | ||
pkg.devDependencies['abortcontroller-polyfill'] = '*'; | ||
pkg.devDependencies['node-fetch'] = '*'; | ||
}) | ||
) | ||
.then(function() { | ||
return app.run('npm', 'install'); | ||
}) | ||
.then(function() { | ||
return app.startServer({ | ||
command: 'serve' | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(function() { | ||
return app.stopServer(); | ||
}); | ||
|
||
it('fetches in fastboot mode', function() { | ||
return get({ | ||
url: 'http://localhost:49741/', | ||
headers: { | ||
Accept: 'text/html' | ||
} | ||
}).then(function(response) { | ||
expect(response.body).to.contain('Hello World! fetch'); | ||
expect(response.body).to.contain('Hello World! fetch (Request)'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters