Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Remove backwards compat shims.
Browse files Browse the repository at this point in the history
Preparing for for [email protected].
  • Loading branch information
rwjblue authored and Robert Jackson committed Aug 18, 2016
1 parent 884a35c commit f78f3a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 58 deletions.
2 changes: 0 additions & 2 deletions blueprints/ember-cli-qunit/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var RSVP = require('rsvp');

module.exports = {
normalizeEntityName: function() {
// this prevents an error when the entityName is
Expand Down
64 changes: 10 additions & 54 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand All @@ -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'
});
Expand All @@ -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.
Expand All @@ -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() {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"homepage": "https://github.com/ember-cli/ember-cli-qunit",
"dependencies": {
"broccoli-babel-transpiler": "^5.5.0",
"broccoli-concat": "^2.2.0",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^1.1.0",
"ember-cli-babel": "^5.1.5",
Expand All @@ -36,7 +35,7 @@
"qunit-notifications": "^0.1.1",
"qunitjs": "^2.0.1",
"resolve": "^1.1.6",
"rsvp": "^3.2.1"
"silent-error": "^1.0.0"
},
"devDependencies": {
"ember-cli": "^2.4.2",
Expand Down

0 comments on commit f78f3a0

Please sign in to comment.