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

Support getOwner #987

Merged
merged 1 commit into from
Feb 12, 2021
Merged

Support getOwner #987

merged 1 commit into from
Feb 12, 2021

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Feb 11, 2021

The test context already has an owner, in the sense of this.owner working. But the standard way to get an owner in Ember is getOwner, which doesn't work.

This makes getOwner work.

A motivating example are these tests which currently use a workaround. They're testing an API that accepts any owned object, and it's nice to use the test context as that object.

The test context already has an owner, in the sense of `this.owner` working. But the standard way to get an owner in Ember is `getOwner`, which doesn't work.

This makes `getOwner` work.

A motivating example are [these tests](https://github.com/embroider-build/embroider/blob/0349de7a5386c30dff8d4aa859fe01138b026878/packages/util/tests/integration/helpers/ensure-safe-component-test.js#L18-L22) which currently use a workaround. They're testing an API that accepts any owned object, and it's nice to use the test context as that object.
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Seems good to me, thank you!

@rwjblue rwjblue merged commit d9bd493 into master Feb 12, 2021
@rwjblue rwjblue deleted the set-owner branch February 12, 2021 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants