This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from rwjblue/refactor
Refactor to use project's bower for deps.
- Loading branch information
Showing
5 changed files
with
82 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
normalizeEntityName: function() { | ||
// this prevents an error when the entityName is | ||
// not specified (since that doesn't actually matter | ||
// to us | ||
}, | ||
|
||
afterInstall: function() { | ||
var addonContext = this; | ||
|
||
return this.addBowerPackageToProject('qunit', '~1.15.0') | ||
.then(function() { | ||
return addonContext.addBowerPackageToProject('stefanpenner/ember-cli-shims', '0.0.3'); | ||
}) | ||
.then(function() { | ||
return addonContext.addBowerPackageToProject('ember-qunit-notifications', '0.0.4'); | ||
}) | ||
.then(function() { | ||
return addonContext.addBowerPackageToProject('ember-qunit', '0.1.8'); | ||
}); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,62 @@ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
function EmberCLIQUnit(project) { | ||
this.project = project; | ||
this.name = 'Ember CLI QUnit'; | ||
} | ||
module.exports = { | ||
name: 'Ember CLI QUnit', | ||
|
||
function unwatchedTree(dir) { | ||
return { | ||
read: function() { return dir; }, | ||
cleanup: function() { } | ||
}; | ||
} | ||
blueprintsPath: function() { | ||
return path.join(__dirname, 'blueprints'); | ||
}, | ||
|
||
EmberCLIQUnit.prototype.treeFor = function treeFor(name) { | ||
if(name !== 'vendor') { return; } | ||
included: function included(app) { | ||
this._super.included(app); | ||
|
||
var treePath = path.join(__dirname, 'vendor'); | ||
if (app.tests) { | ||
var fileAssets = [ | ||
'bower_components/qunit/qunit/qunit.js', | ||
'bower_components/qunit/qunit/qunit.css', | ||
'bower_components/qunit-notifications/index.js', | ||
]; | ||
|
||
if (fs.existsSync(treePath)) { | ||
return unwatchedTree(treePath); | ||
} | ||
}; | ||
|
||
EmberCLIQUnit.prototype.included = function included(app) { | ||
if (app.tests) { | ||
var fileAssets = [ | ||
'vendor/qunit/qunit/qunit.js', | ||
'vendor/qunit/qunit/qunit.css', | ||
'vendor/qunit-notifications/index.js', | ||
]; | ||
var imgAssets = [ | ||
'bower_components/ember-qunit-notifications/passed.png', | ||
'bower_components/ember-qunit-notifications/failed.png', | ||
]; | ||
|
||
var imgAssets = [ | ||
'vendor/ember-qunit-notifications/passed.png', | ||
'vendor/ember-qunit-notifications/failed.png', | ||
]; | ||
|
||
app.import('vendor/ember-qunit/dist/named-amd/main.js', { | ||
type: 'test', | ||
exports: { | ||
'ember-qunit': [ | ||
'globalize', | ||
'moduleFor', | ||
'moduleForComponent', | ||
'moduleForModel', | ||
'test', | ||
'setResolver' | ||
] | ||
} | ||
}); | ||
app.import('bower_components/ember-qunit/dist/named-amd/main.js', { | ||
type: 'test', | ||
exports: { | ||
'ember-qunit': [ | ||
'globalize', | ||
'moduleFor', | ||
'moduleForComponent', | ||
'moduleForModel', | ||
'test', | ||
'setResolver' | ||
] | ||
} | ||
}); | ||
|
||
app.import('vendor/ember-cli-shims/test-shims.js', { | ||
type: 'test', | ||
exports: { | ||
'qunit': ['default'] | ||
} | ||
}); | ||
app.import('bower_components/ember-cli-shims/test-shims.js', { | ||
type: 'test', | ||
exports: { | ||
'qunit': ['default'] | ||
} | ||
}); | ||
|
||
fileAssets.forEach(function(file){ | ||
app.import(file, { | ||
type: 'test' | ||
fileAssets.forEach(function(file){ | ||
app.import(file, { | ||
type: 'test' | ||
}); | ||
}); | ||
}); | ||
|
||
imgAssets.forEach(function(img){ | ||
app.import(img, { | ||
type: 'test', | ||
destDir: 'assets' | ||
imgAssets.forEach(function(img){ | ||
app.import(img, { | ||
type: 'test', | ||
destDir: 'assets' | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
}; | ||
|
||
module.exports = EmberCLIQUnit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters