Skip to content

Commit

Permalink
Filter npm module defintions from catalogEntriesByType
Browse files Browse the repository at this point in the history
More details here: #161
  • Loading branch information
ryanlabouve committed Oct 12, 2016
1 parent 744e766 commit ffa7e2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon/container-debug-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if (typeof ContainerDebugAdapter !== 'undefined') {
for (let i = 0, l = moduleNames.length; i < l; i++) {
let key = moduleNames[i];

if(key.indexOf(type) !== -1) {
if(key.indexOf(type) !== -1 && key.indexOf('npm:') !== 0) {
// Check if it's a pod module
var name = getPod(type, key, this.namespace.podModulePrefix || prefix);
if (!name) {
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/container-debug-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,10 @@ test("Pods podModulePrefix support", function(assert) {
assert.equal(models[0], 'user', "the name is correct");
assert.equal(models[1], 'users/user', "the name is correct");
});

test('Ignores browserify modules', function(assert) {
assert.expect(1);
def('npm:cool/model/package');
var models = containerDebugAdapter.catalogEntriesByType('model');
assert.equal(models.length, 0, 'Ignores the browserify modules');
});

0 comments on commit ffa7e2c

Please sign in to comment.