Skip to content

Commit

Permalink
Switch to treeForAddonTestSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
raido authored and Turbo87 committed Apr 7, 2017
1 parent cfb712c commit 06d3eab
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added addon/.gitkeep
Empty file.
20 changes: 15 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* eslint-env node */

const VersionChecker = require('ember-cli-version-checker');
const Funnel = require('broccoli-funnel');

module.exports = {
name: 'ember-test-selectors',
Expand Down Expand Up @@ -79,11 +80,20 @@ module.exports = {
}
},

treeForAddon() {
// remove our "addon" folder from the build if we're stripping test selectors
if (!this._stripTestSelectors) {
return this._super.treeForAddon.apply(this, arguments);
}
treeForAddonTestSupport(tree) {
// intentionally not calling _super here
// so that can have our `import`'s be
// import testSelector from 'ember-test-selectors';

let namespacedTree = new Funnel(tree, {
srcDir: '/',
destDir: `/${this.moduleName()}`,
annotation: `Addon#treeForTestSupport (${this.name})`,
});

return this.preprocessJs(namespacedTree, '/', this.name, {
registry: this.registry,
});
},

preprocessTree(type, tree) {
Expand Down

0 comments on commit 06d3eab

Please sign in to comment.