Skip to content

Use Application.buildInstance if possible to create owner for use in tests. #234

Closed
@rwjblue

Description

Application.prototype.buildInstance is exactly what is done in "reality" to build the owner object. We should migrate to a setup where the host application sets up the application under test (essentially replacing what is done viasetResolver) in its test-helper.js and then for each test we do something like this.owner = previouslyCreatedApplicationInstance.buildInstance();.

This would essentially provide the following benefits:

  • Run initializers removing the (fairly large) divide between "acceptance" and "integration" tests
    • Automatically run initializers once (for the entire test suite)
    • Run instance-initializers per-test
  • Share the registry for all tests (avoiding wasted work per test)
  • Align our setup process for all test types in preparation for handling acceptance tests in the same manner.
  • Remove the need for significant amounts of private API usage around Ember._RegistryProxyMixin / Ember._ContainerProxyMixin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions