Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
buschtoens opened this issue Nov 22, 2018 · 12 comments
Closed

Comments

@buschtoens
Copy link
Contributor

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.

@NullVoxPopuli
Copy link
Contributor

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

@buschtoens
Copy link
Contributor Author

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.

@pixelhandler
Copy link
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?

@NullVoxPopuli
Copy link
Contributor

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/

@buschtoens
Copy link
Contributor Author

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.

@ppcano
Copy link
Contributor

ppcano commented Dec 21, 2018

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.

@ppcano
Copy link
Contributor

ppcano commented Dec 21, 2018

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.

@ppcano
Copy link
Contributor

ppcano commented Dec 23, 2018

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.

@buschtoens
Copy link
Contributor Author

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

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jan 8, 2019

@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?

@locks
Copy link
Contributor

locks commented May 30, 2019

Closing this issue as we are rethinking the MU approach.

@locks locks closed this as completed May 30, 2019
@NullVoxPopuli
Copy link
Contributor

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
Projects
None yet
Development

No branches or pull requests

5 participants