This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing for for [email protected].
- Loading branch information
Showing
3 changed files
with
11 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,10 +32,10 @@ module.exports = { | |
var checker = new VersionChecker(this); | ||
var dep = checker.for('ember-cli', 'npm'); | ||
|
||
this._shouldImportEmberQUnit = !dep.gt('2.2.0-alpha'); | ||
// fixed in https://github.com/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'); | ||
if (!dep.gt('2.2.0-beta.2')) { | ||
var SilentError = require('silent-error'); | ||
throw new SilentError('[email protected] and higher requires at least ember-cli@2.2.0. Please downgrade to ember-cli-qunit@2 for older ember-cli version support.'); | ||
} | ||
|
||
this.setTestGenerator(); | ||
}, | ||
|
@@ -55,34 +55,10 @@ module.exports = { | |
|
||
var trees = [ | ||
tree, | ||
this._notificationsTree() | ||
this._notificationsTree(), | ||
this.treeGenerator(qunitPath) | ||
]; | ||
|
||
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()); | ||
|
||
var BabelTranspiler = require('broccoli-babel-transpiler'); | ||
var transpiled = new BabelTranspiler(depTree, { | ||
loose: true, | ||
moduleIds: true, | ||
modules: 'amdStrict' | ||
}); | ||
|
||
var Concat = require('broccoli-concat'); | ||
var concattedTree = new Concat(transpiled, { | ||
inputFiles: ['**/*.js'], | ||
outputFile: '/ember-qunit/ember-qunit.js', | ||
annotation: 'Concat: Ember QUnit' | ||
}); | ||
|
||
trees.push(concattedTree); | ||
} | ||
|
||
return new MergeTrees(trees, { | ||
annotation: 'ember-cli-qunit: treeForVendor' | ||
}); | ||
|
@@ -99,26 +75,13 @@ module.exports = { | |
testSupportPath = path.dirname(testSupportPath) || 'assets'; | ||
|
||
if (app.tests) { | ||
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' | ||
]; | ||
} | ||
|
||
fileAssets.push( | ||
var fileAssets = [ | ||
'vendor/qunit/qunit.js', | ||
'vendor/qunit/qunit.css', | ||
'vendor/qunit-notifications/index.js', | ||
'vendor/ember-cli-qunit/qunit-configuration.js', | ||
'vendor/ember-cli-qunit/test-loader.js' | ||
); | ||
]; | ||
|
||
var addonOptions = target.options['ember-cli-qunit']; | ||
// Skip if disableContainerStyles === false. | ||
|
@@ -144,13 +107,6 @@ module.exports = { | |
}); | ||
}); | ||
} | ||
|
||
this.jshintrc = app.options.jshintrc; | ||
|
||
if (this._shouldImportEmberQUnit) { | ||
// support for Ember CLI < 2.2.0-beta.1 | ||
app.import('vendor/ember-qunit/ember-qunit.js', { type: 'test' }); | ||
} | ||
}, | ||
|
||
_notificationsTree: function() { | ||
|
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