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

make getApplication public #336

Merged
merged 2 commits into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- [setupRenderingContext](#setuprenderingcontext)
- [teardownRenderingContext](#teardownrenderingcontext)
- [setApplication](#setapplication)
- [getApplication](#getapplication)
- [setupApplicationContext](#setupapplicationcontext)
- [teardownApplicationContext](#teardownapplicationcontext)
- [validateErrorHandler](#validateerrorhandler)
Expand Down Expand Up @@ -512,6 +513,12 @@ Responsible for:

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<void>** resolves when settled

### getApplication

Retrieves the application instance stored by setApplication.

- Used by `setupContext`.

### setApplication

Stores the provided application instance so that tests being ran will be aware of the application under test.
Expand Down
2 changes: 1 addition & 1 deletion addon-test-support/@ember/test-helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { setResolver, getResolver } from './resolver';
export { setApplication } from './application';
export { getApplication, setApplication } from './application';
export {
default as setupContext,
getContext,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/application-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { application, resolver } from '../helpers/resolver';
import { setApplication, setResolver, getResolver } from '@ember/test-helpers';
import { getApplication, setApplication, setResolver, getResolver } from '@ember/test-helpers';

module('application', function(hooks) {
hooks.beforeEach(function() {
Expand All @@ -26,6 +26,7 @@ module('application', function(hooks) {
actualResolver.isResolverFromTestHelpers,
'should not have used resolver created in tests/helpers/resolver.js'
);
assert.deepEqual(getApplication().constructor, application.constructor);
});

test('calling setApplication when a resolver is set does not clobber existing resolver', function(assert) {
Expand Down