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

build addon-test-support in engine #539

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kellyselden
Copy link
Contributor

@kellyselden kellyselden commented Apr 9, 2018

Addons like https://github.com/kaliber5/ember-window-mock won't work in an engine without building the test-support tree.

simonihmig/ember-window-mock#53

@kellyselden kellyselden changed the title WIP: build addon-test-support in engine build addon-test-support in engine Apr 9, 2018
@villander
Copy link
Member

@kellyselden it works only when environment is equal test?

@kellyselden
Copy link
Contributor Author

@villander I just updated it to only create test-support.js in !== production, just like ember-cli does.

@villander
Copy link
Member

villander commented Apr 12, 2018

@kellyselden make sense for me. This PR seems complement the #538, i'm right?

@kellyselden
Copy link
Contributor Author

They are independent. One is build env and the other is runtime env.

@villander
Copy link
Member

You're right, they're different. Thanks for the solution, I think it looks great to be merged

cc: @rwjblue

@kellyselden kellyselden force-pushed the test-support branch 2 times, most recently from 3347d24 to 6b352b2 Compare April 13, 2018 16:57
@kellyselden kellyselden force-pushed the test-support branch 2 times, most recently from ebb0fda to b66d4a1 Compare April 21, 2018 01:17
@kellyselden
Copy link
Contributor Author

cc @simonihmig This fixes your addon ember-window-mock in engines.

output.contains('assets/node-asset-manifest.js');
// Engine inherites its environment from the parent
output.contains(
`engines-dist/${engineName}/config/environment.js`,
Copy link
Member

Choose a reason for hiding this comment

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

@kellyselden could you add a test where we will ensure this behavior when we access the /tests route in the browser?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it would be easy to test that. I think different environment building should be good.

Copy link
Member

Choose a reason for hiding this comment

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

I also find it a difficult task, but unfortunately we need to ensure that your code works in this right scenario? It's the same problem as the #545

@rwjblue @stefanpenner any idea?

Copy link
Member

Choose a reason for hiding this comment

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

@dgeb do you have any idea of how test this scenario?

@kiwiupover
Copy link
Contributor

@kellyselden Any movement on this PR? I know you have been in Japan having a fun!

@kellyselden
Copy link
Contributor Author

@kiwiupover I think it is done.

@villander
Copy link
Member

@kellyselden can you solve these conflicts and add tests? please

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.

None yet

3 participants