Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fastboot serve refactor (unifying the experience with ember-cli)
- Loading branch information
1 parent
e71e664
commit ecdb661
Showing
18 changed files
with
861 additions
and
308 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
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
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 |
---|---|---|
@@ -1,38 +1,75 @@ | ||
var expect = require('chai').expect; | ||
var RSVP = require('rsvp'); | ||
var request = RSVP.denodeify(require('request')); | ||
var expect = require('chai').expect; | ||
var RSVP = require('rsvp'); | ||
var request = RSVP.denodeify(require('request')); | ||
|
||
var AddonTestApp = require('ember-cli-addon-tests').AddonTestApp; | ||
var AddonTestApp = require('ember-cli-addon-tests').AddonTestApp; | ||
|
||
describe('custom htmlFile', function() { | ||
this.timeout(400000); | ||
|
||
var app; | ||
describe('with fastboot command', function() { | ||
var app; | ||
|
||
before(function() { | ||
app = new AddonTestApp(); | ||
before(function() { | ||
app = new AddonTestApp(); | ||
|
||
return app.create('custom-html-file') | ||
.then(function() { | ||
return app.startServer({ | ||
command: 'fastboot', | ||
additionalArguments: ['--serve-assets'] | ||
return app.create('custom-html-file') | ||
.then(function() { | ||
return app.startServer({ | ||
command: 'fastboot', | ||
additionalArguments: ['--serve-assets'] | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
after(function() { | ||
return app.stopServer(); | ||
}); | ||
|
||
it('uses custom htmlFile', function() { | ||
return request('http://localhost:49741/') | ||
.then(function(response) { | ||
expect(response.statusCode).to.equal(200); | ||
expect(response.headers["content-type"]).to.eq("text/html; charset=utf-8"); | ||
|
||
after(function() { | ||
return app.stopServer(); | ||
expect(response.body).to.contain("<title>custom index</title>"); | ||
expect(response.body).to.contain("<h1>application template</h1>"); | ||
}); | ||
}); | ||
}); | ||
|
||
it('uses custom htmlFile', function() { | ||
return request('http://localhost:49741/') | ||
.then(function(response) { | ||
expect(response.statusCode).to.equal(200); | ||
expect(response.headers["content-type"]).to.eq("text/html; charset=utf-8"); | ||
describe('with serve command', function() { | ||
var app; | ||
|
||
before(function() { | ||
app = new AddonTestApp(); | ||
|
||
expect(response.body).to.contain("<title>custom index</title>"); | ||
expect(response.body).to.contain("<h1>application template</h1>"); | ||
}); | ||
return app.create('custom-html-file') | ||
.then(function() { | ||
return app.startServer({ | ||
command: 'serve' | ||
}); | ||
}); | ||
}); | ||
|
||
after(function() { | ||
return app.stopServer(); | ||
}); | ||
|
||
it('uses custom htmlFile', function() { | ||
return request({ | ||
url: 'http://localhost:49741/', | ||
headers: { | ||
'Accept': 'text/html' | ||
} | ||
}) | ||
.then(function(response) { | ||
expect(response.statusCode).to.equal(200); | ||
expect(response.headers["content-type"]).to.eq("text/html; charset=utf-8"); | ||
|
||
expect(response.body).to.contain("<title>custom index</title>"); | ||
expect(response.body).to.contain("<h1>application template</h1>"); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.