Skip to content

return actual name not function from _parentName - #52

Merged
rwjblue merged 3 commits into
ember-cli-code-coverage:masterfrom
nfc036:master
Oct 10, 2016
Merged

rwjblue merged 3 commits into
ember-cli-code-coverage:masterfrom
nfc036:master

Conversation

@nfc036

@nfc036 nfc036 commented Oct 10, 2016

Copy link
Copy Markdown
Contributor

this.parent.name is a function (if defined), this.parent.pkg.name is the expected name of the package.
Using 0.3.3 I get no coverage for any files in the app. (worked in 0.3.2)

this.parent.name is a function (if defined), this.parent.pkg.name is the expected name of the package.
@nfc036

nfc036 commented Oct 10, 2016

Copy link
Copy Markdown
Contributor Author

The failing test expects name to be the actual name (string). If I am right, name is the corresponding function here in ember-cli. Hence, the test is incorrect. Possible?

@rwjblue

rwjblue commented Oct 10, 2016

Copy link
Copy Markdown
Collaborator

Name in an addon is a property, but in a project it is a function (which is where you linked to above).

@rwjblue

rwjblue commented Oct 10, 2016

Copy link
Copy Markdown
Collaborator

@dfreeman - Would you mind reviewing this?

@rwjblue rwjblue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need tests for when parent is an addon and is not, are they already present?

Comment thread index.js
return this._findCoveredAddon().name;
} else {
return this.parent.name;
return this.parent.name();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! This seems totally correct, sorry for the misleading comments without reading the diff carefully.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... sorry for the misleading comments regarding the commits... ;-)

@rwjblue
rwjblue merged commit cf836fc into ember-cli-code-coverage:master Oct 10, 2016
@rwjblue

rwjblue commented Oct 10, 2016

Copy link
Copy Markdown
Collaborator

Published as 0.3.4, thanks for your help reporting and fixing this!

@dfreeman

Copy link
Copy Markdown
Contributor

Tests were present, just wrong (as you found) 😣 — sorry about that! Thanks for the fix, @nfc036.

@rwjblue

rwjblue commented Oct 10, 2016

Copy link
Copy Markdown
Collaborator

Thank you for reviewing @dfreeman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants