You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No coverage when addon and package name don't match #45
We have an npm scope associated with our private registry, so our internal addons all have scoped package names like @scope/foo-bar. They use the unscoped version (foo-bar) for the name in their index.js, which unfortunately causes ember-cli-code-coverage to filter out all our actual addon files.
Locally, I've had success replacing instances of project.pkg.name with project.name(), which returns the package's "base name" (everything after the last /). It works for our use case, and I started to open a PR with that change, but it doesn't seem like it solves the underlying problem — the name in package.json and the name in index.js aren't necessarily related.
Given that the covered addon is looked up by name here, it seems like kind of a catch-22 unless there's another way to track down the Addon instance without knowing its name. Any guidance on this? Are mismatched package and addon names even something this addon needs to handle, or is it enough of an antipattern that it should just be discouraged?
That location for app/addon name was just the first/easiest place to find it. If a better or more complex way of determining it that covers more cases is possible, it should definitely be explored.
Actually, looking at the implementation of findAddonByName, it supports looking up addons by their package name if it doesn't match their configured name. I'll see if I can pull something together based on that.
Activity
kellyselden commentedon Sep 21, 2016
That location for app/addon name was just the first/easiest place to find it. If a better or more complex way of determining it that covers more cases is possible, it should definitely be explored.
dfreeman commentedon Sep 21, 2016
Actually, looking at the implementation of
findAddonByName, it supports looking up addons by their package name if it doesn't match their configured name. I'll see if I can pull something together based on that.