-
-
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.
Ignore fastboot build output file if app unused/disable fastboot (#468)
Ignore fastboot build output file if app unused/disable fastboot
- Loading branch information
1 parent
4df1bf0
commit 6d6e700
Showing
2 changed files
with
61 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use strict'; | ||
const chai = require('chai'); | ||
const expect = chai.expect; | ||
chai.use(require('chai-fs')); | ||
|
||
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp; | ||
|
||
describe('it builds without ember-cli-fastboot', function() { | ||
this.timeout(300000); | ||
|
||
let app; | ||
|
||
beforeEach(function() { | ||
app = new AddonTestApp(); | ||
}); | ||
|
||
it('builds no exist dist/ember-fetch/fetch-fastboot.js', function() { | ||
return app | ||
.create('dummy', { skipNpm: true }) | ||
.then((app) => | ||
app.editPackageJSON((pkg) => { | ||
delete pkg.devDependencies['ember-cli-fastboot']; | ||
}) | ||
) | ||
.then(() => app.run('npm', 'install')) | ||
.then(() => app.runEmberCommand('build')) | ||
.then(function() { | ||
expect(app.filePath('dist/index.html')).to.be.a.file(); | ||
expect(app.filePath('dist/ember-fetch')).to.not.be.a.path(); | ||
}); | ||
}); | ||
|
||
it('build with process.env.FASTBOOT_DISABLED', function() { | ||
process.env.FASTBOOT_DISABLED = 'true'; | ||
return app | ||
.create('dummy', { skipNpm: true }) | ||
.then((app) => | ||
app.editPackageJSON((pkg) => { | ||
pkg.devDependencies['ember-cli-fastboot'] = '*'; | ||
}) | ||
) | ||
.then(() => app.run('npm', 'install')) | ||
.then(() => app.runEmberCommand('build')) | ||
.then(function() { | ||
expect(app.filePath('dist/index.html')).to.be.a.file(); | ||
expect(app.filePath('dist/ember-fetch')).to.not.be.a.path(); | ||
}) | ||
.then( | ||
function() { | ||
delete process.env.FASTBOOT_DISABLED; | ||
}, | ||
function() { | ||
delete process.env.FASTBOOT_DISABLED; | ||
} | ||
); | ||
}); | ||
}); |