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

Rename to @ember/test-helpers. #241

Merged
merged 3 commits into from
Nov 11, 2017
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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ember-test-helpers [![Build Status](https://secure.travis-ci.org/emberjs/ember-test-helpers.png?branch=master)](http://travis-ci.org/emberjs/ember-test-helpers)
# @ember/test-helpers [![Build Status](https://secure.travis-ci.org/emberjs/ember-test-helpers.png?branch=master)](http://travis-ci.org/emberjs/ember-test-helpers)

A test-framework-agnostic set of helpers for testing Ember.js applications.

Expand All @@ -15,9 +15,12 @@ standard Ember testing experience to any testing framework.

A quick summary of the exports from the `ember-test-helpers` module:

* `setResolver` - This function is used to allow the other functions build a valid
container/registry that is able to look objects up from your application (just as a running Ember
application would).
* `setApplication` - This function is used to allow the rest of the setup
functions to build a valid container/registry which can be used to lookup
instances and factories from your application.
* `setResolver` - When `setApplication` has not been ran, this function is used to allow the other
functions build a valid container/registry that is able to look objects up
from your application (just as a running Ember application would).
* `setContext` - Invoked by the host testing framework to set the current testing context (generally
the `this` within a running test).
* `getContext` - Used to retrieve the current testing context.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Promise } from 'rsvp';

import legacyBuildRegistry from './legacy-0-6-x/build-registry';
import legacyBuildRegistry from 'ember-test-helpers/legacy-0-6-x/build-registry';

export default function({ application, resolver }) {
if (application) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
// TODO: deprecate these once new API is rolled out
export { default as TestModule } from './legacy-0-6-x/test-module';
export { default as TestModuleForAcceptance } from './legacy-0-6-x/test-module-for-acceptance';
export { default as TestModuleForComponent } from './legacy-0-6-x/test-module-for-component';
export { default as TestModuleForModel } from './legacy-0-6-x/test-module-for-model';

export { setResolver } from './resolver';
export { setResolver, getResolver } from './resolver';
export { setApplication } from './application';
export {
default as setupContext,
Expand Down
1 change: 1 addition & 0 deletions addon-test-support/ember-test-helpers/has-ember-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@ember/test-helpers/has-ember-version';
7 changes: 7 additions & 0 deletions addon-test-support/ember-test-helpers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from '@ember/test-helpers';

// TODO: deprecate these once new API is rolled out
export { default as TestModule } from './legacy-0-6-x/test-module';
export { default as TestModuleForAcceptance } from './legacy-0-6-x/test-module-for-acceptance';
export { default as TestModuleForComponent } from './legacy-0-6-x/test-module-for-component';
export { default as TestModuleForModel } from './legacy-0-6-x/test-module-for-model';
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { run } from '@ember/runloop';
import { Promise as EmberPromise, resolve } from 'rsvp';
import { assign, merge as emberMerge } from '@ember/polyfills';
import { _setupPromiseListeners, _teardownPromiseListeners } from '../ext/rsvp';
import { _setupAJAXHooks, _teardownAJAXHooks } from '../settled';
import { getContext, setContext, unsetContext } from '../setup-context';
import { _setupPromiseListeners, _teardownPromiseListeners } from '@ember/test-helpers/ext/rsvp';
import { _setupAJAXHooks, _teardownAJAXHooks } from '@ember/test-helpers/settled';
import { getContext, setContext, unsetContext } from '@ember/test-helpers';

import Ember from 'ember';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { run } from '@ember/runloop';
import AbstractTestModule from './abstract-test-module';
import { getContext } from '../setup-context';
import { getContext } from '@ember/test-helpers';

export default class extends AbstractTestModule {
setupContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { set } from '@ember/object';
import { run } from '@ember/runloop';
import { setOwner } from '@ember/application';
import AbstractTestModule from './abstract-test-module';
import { getResolver } from '../resolver';
import { getResolver } from '@ember/test-helpers';
import buildRegistry from './build-registry';
import hasEmberVersion from '../has-ember-version';
import hasEmberVersion from '@ember/test-helpers/has-ember-version';

export default class extends AbstractTestModule {
constructor(subjectName, description, callbacks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export {
_setupPromiseListeners,
_teardownAJAXHooks,
_teardownPromiseListeners,
} from './settled';
} from '@ember/test-helpers/settled';
10 changes: 1 addition & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ module.exports = {
// so that can have our `import`'s be
// import { ... } from 'ember-test-helpers';

const Funnel = require('broccoli-funnel');

let namespacedTree = new Funnel(tree, {
srcDir: '/',
destDir: `/${this.moduleName()}`,
annotation: `Addon#treeForTestSupport (${this.name})`,
});

return this.preprocessJs(namespacedTree, '/', this.name, {
return this.preprocessJs(tree, '/', this.name, {
registry: this.registry,
});
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ember-test-helpers",
"name": "@ember/test-helpers",
"version": "0.7.0-beta.11",
"description": "Helpers for testing Ember.js applications",
"keywords": [
Expand Down