Skip to content

Commit

Permalink
Merge pull request #124 from Turbo87/kill-bower
Browse files Browse the repository at this point in the history
Load Mocha and Chai from NPM
  • Loading branch information
rwjblue authored Aug 14, 2016
2 parents 3e758b9 + c946657 commit bb5a40f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
2 changes: 0 additions & 2 deletions blueprints/ember-cli-mocha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +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' }
]).then(function() {
Expand Down
2 changes: 0 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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"
}
}
22 changes: 19 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ 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 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, {
Expand All @@ -105,6 +119,8 @@ module.exports = {

var trees = [
tree,
mochaTree,
chaiTree,
mochaSetupTree
];

Expand Down Expand Up @@ -146,9 +162,9 @@ module.exports = {

if (app.tests) {
var fileAssets = [
app.bowerDirectory + '/mocha/mocha.js',
app.bowerDirectory + '/mocha/mocha.css',
app.bowerDirectory + '/chai/chai.js',
'vendor/mocha/mocha.js',
'vendor/mocha/mocha.css',
'vendor/chai/chai.js',
'vendor/ember-mocha/mocha-setup.js',
app.bowerDirectory + '/ember-mocha-adapter/adapter.js',
'vendor/ember-cli-mocha/test-loader.js'
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@
"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",
"exists-sync": "0.0.3",
"mocha": "^2.5.3",
"resolve": "^1.1.7"
}
}

0 comments on commit bb5a40f

Please sign in to comment.