-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Use Application.create().buildInstance()
if possible.
#237
Conversation
292335c
to
23b62cb
Compare
@rwjblue looks like CI is unhappy with this change |
Yep! Still WIP for now. I have a few things to do first (updated with checklist in issue description). |
23b62cb
to
f5ec85a
Compare
992d524
to
93fc750
Compare
Handle the "normal" case of building a application instance instance, but if using the older "custom resolver" system just fall back to use the legacy build registry function.
Application.create().buildInstance()
.Application.create().buildInstance()
.
Application.create().buildInstance()
.Application.create().buildInstance()
if possible.
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.
I have to admit that I have no clue of what I'm looking at here so this is quite hard for me to review 😞
resolve(fullName) { | ||
return registry[fullName] || this._super(...arguments); | ||
}, | ||
}); |
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.
is that going to be required for all apps?
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.
No, absolutely not! This is only a thing needed to test things internally here. Basically the setResolverRegistry
test helper function (just here in the tests of this repo) resets the list of "known" modules so that we can test things like this.owner.register
"wins" over what is resolved, and whatnot.
No problem, thanks for taking a look! |
When the host project properly registers their application, the testing context will now boot a lightweight instance of the application (similar to what FastBoot does).
In this scenario both
initializers
andinstance-initializers
will run so no more manual initializer setup shenanigans (as documented here fore mirage). This has been a very long standing point of confusion for folks while testing, and I'm very excited to finally have a path forward that is both performant and intuitive.For those curious,
initializers
will run only once for the entire test suite (unlike acceptance tests prior to emberjs/rfcs#268), and theinstance-initializers
will run once per test (which also mirrors how FastBoot works internally).This new system nearly identically matches how real applications work in the wild, and is a much less brittle platform for our continued testing "unification".
Fixes #234