From c94665737eeacaadf652c74ffdd6c0477e9ba6ba Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 14 Aug 2016 12:57:11 +0200 Subject: [PATCH] Convert "chai" from Bower to NPM dependency --- blueprints/ember-cli-mocha/index.js | 1 - bower.json | 1 - index.js | 10 +++++++++- package.json | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blueprints/ember-cli-mocha/index.js b/blueprints/ember-cli-mocha/index.js index 054eac6..e6d79d2 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: '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' } ]).then(function() { diff --git a/bower.json b/bower.json index 954275e..0f1d0d8 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", - "chai": "~2.3.0", "ember-mocha-adapter": "~0.3.1" } } diff --git a/index.js b/index.js index 8eba9f1..e28a311 100644 --- a/index.js +++ b/index.js @@ -103,6 +103,13 @@ module.exports = { destDir: '/mocha', }); + var chaiPath = path.dirname(resolve.sync('chai')); + // var chaiTree = this.treeGenerator(chaiPath); + var chaiTree = new Funnel(chaiPath, { + files: ['chai.js'], + destDir: '/chai', + }); + var emberMochaBuildSupportPath = path.join(this._emberMochaLibPath, '..', 'build-support'); var mochaSetupTree = new Funnel(emberMochaBuildSupportPath, { @@ -113,6 +120,7 @@ module.exports = { var trees = [ tree, mochaTree, + chaiTree, mochaSetupTree ]; @@ -156,7 +164,7 @@ module.exports = { var fileAssets = [ 'vendor/mocha/mocha.js', 'vendor/mocha/mocha.css', - app.bowerDirectory + '/chai/chai.js', + 'vendor/chai/chai.js', 'vendor/ember-mocha/mocha-setup.js', app.bowerDirectory + '/ember-mocha-adapter/adapter.js', 'vendor/ember-cli-mocha/test-loader.js' diff --git a/package.json b/package.json index 3591cf4..e0c69a4 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "broccoli-concat": "^2.1.0", "broccoli-funnel": "^1.0.1", "broccoli-merge-trees": "^1.1.1", + "chai": "^3.5.0", "ember-cli-babel": "^5.1.6", "ember-cli-version-checker": "^1.1.6", "ember-mocha": "^0.8.11",