Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ module.exports = {

// Ember Methods

included: function() {
included: function(appOrAddon) {
this._super.included.apply(this, arguments);

this.fileLookup = {};
this.parentRegistry = appOrAddon.registry;

if (!this._registeredWithBabel && this._isCoverageEnabled()) {
let checker = new VersionChecker(this.parent).for('ember-cli-babel', 'npm');
Expand Down Expand Up @@ -201,7 +202,7 @@ module.exports = {
_getIncludesForDir: function(dir, prefix) {
if (fs.existsSync(dir)) {
let dirname = path.relative(this.project.root, dir);
let globs = this.registry.extensionsForType('js').map((extension) => `**/*.${extension}`);
let globs = this.parentRegistry.extensionsForType('js').map((extension) => `**/*.${extension}`);

return walkSync(dir, { directories: false, globs }).map(file => {
let module = prefix + '/' + file.replace(EXT_RE, '.js');
Expand Down
4 changes: 2 additions & 2 deletions test/unit/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe('index.js', function() {
beforeEach(function() {
sandbox = sinon.sandbox.create();

Index.parent = Index.project = Index.app = Index.IstanbulPlugin = Index.registry = null;
Index.parent = Index.project = Index.app = Index.IstanbulPlugin = Index.parentRegistry = null;
sandbox.stub(Index, 'fileLookup').value({});
sandbox.stub(Index, 'registry').value({
sandbox.stub(Index, 'parentRegistry').value({
extensionsForType: function() {
return ['js'];
}
Expand Down