-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Add option to render to enable improved ember-engines testing API #795
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was looking at only one of your commits, not all of them. And I was also reacting the code you pasted here in the comments, which I didn't realize isn't actually code in your PR.
addon-test-support/@ember/test-helpers/setup-rendering-context.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
We've landed a bunch of fixes to make CI more consistent (dropping Node < 10, reroll yarn.lock, etc), probably needs a rebase to kick things off again. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rwjblue any chance to have a look here to make a progress? |
I think this is good to go now!! Thanks @villander @richgt! |
Add new `RenderOptions` option to be passed to `render`. This allows ember-engines to provide customized test setup code that users can use to build and Engine instance and perform simpler rendering tests that from the context of that Engine. Co-Authored-By: Rich Glazerman <[email protected]> Co-Authroed-By: Robert Jackson <[email protected]>
@@ -28,6 +29,36 @@ import { | |||
} from '../helpers/resolver'; | |||
import { hbs } from 'ember-cli-htmlbars'; | |||
import { getOwner } from '@ember/application'; | |||
import Engine from '@ember/engine'; | |||
|
|||
async function buildEngineOwner(parentOwner, registry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this is what the normal router setup would do for creating an engine instance.
Add a second argument to
render
helper that can be used to specify a custom owner to be used for the provided template. This allows ember-engines to provide customized test setup code that users can useto build and Engine instance and perform simpler rendering tests that from the context of that Engine.
When coupled with changes in ember-engines itself (ember-engines/ember-engines#653), an API similar to the following will be possible: