Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with 1.2.0+ and [email protected].{1,2}. #99

Merged
merged 1 commit into from
Jan 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ module.exports = {
var checker = new VersionChecker(this);
var dep = checker.for('ember-cli', 'npm');

// support for Ember CLI < 2.2.0-beta.1
this._shouldImportEmberQUnit = !dep.gt('2.2.0-alpha');
// fixed in https:/ember-cli/ember-cli/pull/5274
// this can be removed when we no longer support 2.2.0-beta.{1,2}
this._shouldImportQUnit = !dep.gt('2.2.0-beta.2');
},

blueprintsPath: function() {
Expand All @@ -71,10 +73,13 @@ module.exports = {
var qunitPath = path.join(path.dirname(resolve.sync('qunitjs')), '..');

var trees = [
tree,
this.treeGenerator(qunitPath)
tree
];

if (!this._shouldImportQUnit) {
trees.push(this.treeGenerator(qunitPath));
}

if (this._shouldImportEmberQUnit) {
// support for Ember CLI < 2.2.0-beta.1
var depTree = new MergeTrees(this._getDependencyTrees());
Expand Down Expand Up @@ -110,10 +115,21 @@ module.exports = {
testSupportPath = path.dirname(testSupportPath) || 'assets';

if (app.tests) {
var fileAssets = [
'vendor/qunit/qunit.js',
'vendor/qunit/qunit.css'
];
var fileAssets;

if (this._shouldImportQUnit) {
// ember-cli < 2.2.0-beta.3 gets this from bower
fileAssets = [
target.bowerDirectory + '/qunit/qunit/qunit.js',
target.bowerDirectory + '/qunit/qunit/qunit.css'
];
} else {
fileAssets = [
'vendor/qunit/qunit.js',
'vendor/qunit/qunit.css'
];
}


var imgAssets = [];

Expand Down