Skip to content

[Module Unification] Addon tests are hoisted into the host application #17224

Closed

Description

@buschtoens

Quest: #16373

*-test.js files from an addon are hoisted into the consuming host application, just like regular files, e.g. component.js. This means that running ember test in the host application will also attempt to run the addon's tests.

I don't think that this is intended / desired behavior. It's also causing errors, if the addon tests import dev dependencies, which are not available in the host application.

Activity

  1. NullVoxPopuli commented on Nov 26, 2018

    @NullVoxPopuli
    SponsorContributor

    with a recent build of https://emberclear.io,
    I'm witnessing this behavior as well -- not any errors, but just tests being included in the bundle.

    Here is my "current" bundle: https://nullvoxpopuli.gitlab.io/emberclear/master/bundle.html
    image
    image

  2. buschtoens commented on Nov 26, 2018

    @buschtoens
    ContributorAuthor

    not any errors

    Sorry for being unclear here. I was referring to the the wrongfully included tests failing or failing to load, because they are importing dev dependencies (of the addon they belong to), which are not available in the host application.

  3. pixelhandler commented on Nov 30, 2018

    @pixelhandler
    Contributor

    @buschtoens would this be an issue for https://github.com/ember-cli/ember-cli/issues ? seems that the expected behavior is when I visit http://localhost:4200/tests that only my application tests should be run, and no (addon/dependency) tests should be included. And running ember test or ember test -s should also only execute application tests?

    But, it sounds like the actual behavior you see is that in all of the above scenarios addon (dependency) tests are included and executed?

    Can you provide an example repo?

  4. NullVoxPopuli commented on Nov 30, 2018

    @NullVoxPopuli
    SponsorContributor

    But, it sounds like the actual behavior you see is that in all of the above scenarios addon (dependency) tests are included and executed?

    For me, it's the application tests that are being included in the production repo.

    Here is my repo:
    https://github.com/NullVoxPopuli/emberclear/

  5. buschtoens commented on Nov 30, 2018

    @buschtoens
    ContributorAuthor

    would this be an issue for ember-cli/ember-cli/issues?

    I was not sure at what level the filtering happens. But it'd make sense to filter addon tests at the build level, yes.

  6. ppcano commented on Dec 21, 2018

    @ppcano
    Contributor

    I will look at this issue soon and try to implement a fix.

    would this be an issue for ember-cli/ember-cli/issues?

    I think so.

  7. ppcano commented on Dec 21, 2018

    @ppcano
    Contributor

    t's the application tests that are being included in the production repo

    It should be fixed by ember-cli/ember-cli#8314

    @buschtoens I am not sure if 👆 fixes the addon issue.

  8. ppcano commented on Dec 23, 2018

    @ppcano
    Contributor

    ember-cli/ember-cli#8314 has been merged.

    @buschtoens please, would you mind to test again the addon issue and inform if the problem has been fixed.

  9. buschtoens commented on Dec 23, 2018

    @buschtoens
    ContributorAuthor

    @ppcano Thanks! I'll have a look soon. Currently busy with 🎅 stuff. 😉

  10. NullVoxPopuli commented on Jan 8, 2019

    @NullVoxPopuli
    SponsorContributor

    @ppcano @buschtoens my bundle: https://emberclear.io/bundle.html
    image

    in my app bundle it looks like tests that I generically named -acceptance-test.ts are included.
    so, maybe the filter pattern needs updating?

  11. locks commented on May 30, 2019

    @locks
    Contributor

    Closing this issue as we are rethinking the MU approach.

  12. NullVoxPopuli commented on May 30, 2019

    @NullVoxPopuli
    SponsorContributor

    According to: https://emberclear.io/bundle.html
    I think this was actually resolved and forgetten haha 🎉

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions