From ecdae6e4bd5d6c9818cf4279900897829f7a5eea Mon Sep 17 00:00:00 2001 From: nfc036 Date: Mon, 10 Oct 2016 13:31:13 +0200 Subject: [PATCH 1/3] return actual name not function from _parentName this.parent.name is a function (if defined), this.parent.pkg.name is the expected name of the package. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b960a316..8cad6680 100644 --- a/index.js +++ b/index.js @@ -252,7 +252,7 @@ module.exports = { if (this.parent.isEmberCLIAddon()) { return this._findCoveredAddon().name; } else { - return this.parent.name; + return this.parent.pkg.name; } }, From dae3da1ddea1057f12b0d7ee8306619617cb9b5b Mon Sep 17 00:00:00 2001 From: nfc036 Date: Mon, 10 Oct 2016 14:15:24 +0200 Subject: [PATCH 2/3] parent.name is function not string Tests adjusted according to [ember-cli/lib/models/project.js](https://github.com/ember-cli/ember-cli/blob/1cae632e9724d0fc02cb91e90d83e70e78f75069/lib/models/project.js#L142). --- test/unit/index-test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit/index-test.js b/test/unit/index-test.js index 85f946d6..2b542be6 100644 --- a/test/unit/index-test.js +++ b/test/unit/index-test.js @@ -256,6 +256,9 @@ describe('index.js', function() { Index.parent = { isEmberCLIAddon: function() { return false; + }, + name: function() { + return 'test'; } }; }); @@ -403,7 +406,9 @@ describe('index.js', function() { beforeEach(function() { Index.parent = { - name: 'parent-app', + name: function() { + return 'parent-app'; + }, isEmberCLIAddon: function() { return isAddon; } From 6f86df5cde4ffd8d786247a80d9fd51e781fcb8d Mon Sep 17 00:00:00 2001 From: nfc036 Date: Mon, 10 Oct 2016 14:16:50 +0200 Subject: [PATCH 3/3] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8cad6680..72c2b63b 100644 --- a/index.js +++ b/index.js @@ -252,7 +252,7 @@ module.exports = { if (this.parent.isEmberCLIAddon()) { return this._findCoveredAddon().name; } else { - return this.parent.pkg.name; + return this.parent.name(); } },