From 958e8b39aed8204e3fbb7586e6d46db8a3503062 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 13 Dec 2015 16:13:02 -0500 Subject: [PATCH] Make QUnit an NPM dep. --- blueprints/ember-cli-qunit/index.js | 1 - index.js | 19 ++++++++++++++----- package.json | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/blueprints/ember-cli-qunit/index.js b/blueprints/ember-cli-qunit/index.js index 68bf59ca..fe71effc 100644 --- a/blueprints/ember-cli-qunit/index.js +++ b/blueprints/ember-cli-qunit/index.js @@ -7,7 +7,6 @@ module.exports = { afterInstall: function() { return this.addBowerPackagesToProject([ - { name: 'qunit', target: '~1.20.0' }, { name: 'ember-cli-test-loader', target: '0.2.1' }, { name: 'ember-qunit-notifications', target: '0.1.0' } ]); diff --git a/index.js b/index.js index 43948f1b..be0bf556 100644 --- a/index.js +++ b/index.js @@ -68,6 +68,13 @@ module.exports = { }, treeForVendor: function(tree) { + var qunitPath = path.join(path.dirname(resolve.sync('qunitjs')), '..'); + + var trees = [ + tree, + this.treeGenerator(qunitPath) + ]; + if (this._shouldImportEmberQUnit) { // support for Ember CLI < 2.2.0-beta.1 var depTree = new MergeTrees(this._getDependencyTrees()); @@ -84,10 +91,12 @@ module.exports = { annotation: 'Concat: Ember QUnit' }); - return new MergeTrees([concattedTree, tree]); - } else { - return tree; + trees.push(concattedTree); } + + return new MergeTrees(trees, { + annotation: 'ember-cli-qunit: treeForVendor' + }); }, included: function included(app, parentAddon) { @@ -102,8 +111,8 @@ module.exports = { if (app.tests) { var fileAssets = [ - app.bowerDirectory + '/qunit/qunit/qunit.js', - app.bowerDirectory + '/qunit/qunit/qunit.css' + 'vendor/qunit/qunit.js', + 'vendor/qunit/qunit.css' ]; var imgAssets = []; diff --git a/package.json b/package.json index b6c77271..2638f858 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "broccoli-sourcemap-concat": "^1.1.6", "ember-cli-version-checker": "^1.1.4", "ember-qunit": "^0.4.18", + "qunitjs": "^1.20.0", "resolve": "^1.1.6" }, "bundledDependencies": []