Skip to content

Commit

Permalink
Remove ember-qunit-notifications and import qunit-notifications from NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
trentmwillis committed May 24, 2016
1 parent 9394629 commit df449e2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
4 changes: 1 addition & 3 deletions blueprints/ember-cli-qunit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module.exports = {
},

afterInstall: function() {
return this.addBowerPackageToProject('ember-qunit-notifications', '0.1.0').then(function() {
return this.addPackageToProject('ember-cli-test-loader', '^1.1.0');
});
return this.addPackageToProject('ember-cli-test-loader', '^1.1.0');
}
};
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "ember-cli-qunit",
"dependencies": {
"ember": "~2.4.1",
"ember-cli-shims": "0.1.0",
"ember-qunit-notifications": "0.1.0"
"ember-cli-shims": "0.1.0"
}
}
33 changes: 19 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var path = require('path');
var fs = require('fs');
var resolve = require('resolve');
var MergeTrees = require('broccoli-merge-trees');
var Funnel = require('broccoli-funnel');
var BabelTranspiler = require('broccoli-babel-transpiler');
var Concat = require('broccoli-concat');
var VersionChecker = require('ember-cli-version-checker');
Expand Down Expand Up @@ -55,7 +56,8 @@ module.exports = {
var qunitPath = path.join(path.dirname(resolve.sync('qunitjs')), '..');

var trees = [
tree
tree,
this._notificationsTree()
];

if (!this._shouldImportQUnit) {
Expand Down Expand Up @@ -112,19 +114,8 @@ module.exports = {
];
}


var imgAssets = [];

var qunitNotificationsPath = app.bowerDirectory + '/qunit-notifications/index.js';
if (fs.existsSync(qunitNotificationsPath)) {
fileAssets.push(qunitNotificationsPath);
imgAssets.push(
app.bowerDirectory + '/ember-qunit-notifications/passed.png',
app.bowerDirectory + '/ember-qunit-notifications/failed.png'
);
}

fileAssets.push(
'vendor/qunit-notifications/index.js',
'vendor/ember-cli-qunit/qunit-configuration.js',
'vendor/ember-cli-qunit/test-loader.js'
);
Expand All @@ -141,7 +132,12 @@ module.exports = {
});
});

imgAssets.forEach(function(img){
var imgAssets = [
'vendor/ember-cli-qunit/images/passed.png',
'vendor/ember-cli-qunit/images/failed.png'
];

imgAssets.forEach(function(img) {
app.import(img, {
type: 'test',
destDir: testSupportPath
Expand All @@ -157,6 +153,15 @@ module.exports = {
}
},

_notificationsTree: function() {
var notificationsPath = path.dirname(resolve.sync('qunit-notifications'));
return new Funnel(notificationsPath, {
include: [ 'index.js' ],
destDir: 'qunit-notifications',
annotation: 'qunit-notifications'
});
},

contentFor: function(type) {
// Skip if insertContentForTestBody === false.
if (type === 'test-body' && !(this.options['ember-cli-qunit'] && this.options['ember-cli-qunit'].insertContentForTestBody === false)) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@
"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",
"ember-cli-version-checker": "^1.1.4",
"ember-qunit": "^0.4.18",
"qunit-notifications": "^0.1.1",
"qunitjs": "^1.20.0",
"resolve": "^1.1.6",
"rsvp": "^3.2.1"
},
"bundledDependencies": [],
"devDependencies": {
"ember-cli": "^2.4.2",
"ember-cli-htmlbars": "^1.0.3",
Expand Down
Binary file added vendor/ember-cli-qunit/images/failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vendor/ember-cli-qunit/images/passed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit df449e2

Please sign in to comment.