From f8a1ea9dae0a4828a26b89a605f1aa13879cf6e5 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 14 Aug 2016 12:56:39 +0200 Subject: [PATCH] Convert "mocha" from Bower to NPM dependency --- blueprints/ember-cli-mocha/index.js | 1 - bower.json | 1 - index.js | 12 ++++++++++-- package.json | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/blueprints/ember-cli-mocha/index.js b/blueprints/ember-cli-mocha/index.js index ccf0583..054eac6 100644 --- a/blueprints/ember-cli-mocha/index.js +++ b/blueprints/ember-cli-mocha/index.js @@ -13,7 +13,6 @@ module.exports = { var addonContext = this; return this.addBowerPackagesToProject([ - { name: 'mocha', source: 'mocha', target: '~2.2.4' }, { name: 'chai', source: 'chai', target: '~2.3.0' }, { name: 'ember-mocha-adapter', source: 'ember-mocha-adapter', target: '~0.3.1' }, { name: 'ember-cli-test-loader', source: 'ember-cli-test-loader', target: '0.2.2' } diff --git a/bower.json b/bower.json index 64f17f6..954275e 100644 --- a/bower.json +++ b/bower.json @@ -5,7 +5,6 @@ "ember-cli-shims": "0.1.1", "ember-cli-test-loader": "0.2.2", "ember-qunit-notifications": "0.1.0", - "mocha": "~2.4.5", "chai": "~2.3.0", "ember-mocha-adapter": "~0.3.1" } diff --git a/index.js b/index.js index 54902d5..8eba9f1 100644 --- a/index.js +++ b/index.js @@ -96,6 +96,13 @@ module.exports = { }, treeForVendor: function(tree) { + var mochaPath = path.dirname(resolve.sync('mocha')); + // var mochaTree = this.treeGenerator(mochaPath); + var mochaTree = new Funnel(mochaPath, { + files: ['mocha.js', 'mocha.css'], + destDir: '/mocha', + }); + var emberMochaBuildSupportPath = path.join(this._emberMochaLibPath, '..', 'build-support'); var mochaSetupTree = new Funnel(emberMochaBuildSupportPath, { @@ -105,6 +112,7 @@ module.exports = { var trees = [ tree, + mochaTree, mochaSetupTree ]; @@ -146,8 +154,8 @@ module.exports = { if (app.tests) { var fileAssets = [ - app.bowerDirectory + '/mocha/mocha.js', - app.bowerDirectory + '/mocha/mocha.css', + 'vendor/mocha/mocha.js', + 'vendor/mocha/mocha.css', app.bowerDirectory + '/chai/chai.js', 'vendor/ember-mocha/mocha-setup.js', app.bowerDirectory + '/ember-mocha-adapter/adapter.js', diff --git a/package.json b/package.json index 95d0410..3591cf4 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "ember-cli-version-checker": "^1.1.6", "ember-mocha": "^0.8.11", "exists-sync": "0.0.3", + "mocha": "^2.5.3", "resolve": "^1.1.7" } }