Skip to content

Commit

Permalink
Deprecate legacy test APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
chadhietala committed May 6, 2019
1 parent ce02294 commit 247482d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { createModule } from './qunit-module';
import { TestModuleForComponent } from 'ember-test-helpers';
import Ember from 'ember';

export default function moduleForComponent(name, description, callbacks) {
createModule(TestModuleForComponent, name, description, callbacks);
Ember.deprecate(`The usage "moduleForComponent" is deprecated. Please migrate the "${name}" module to the new test APIs.`, false, {
id: 'deprecate-legacy-apis',
until: '5.0.0',
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md'
});
}
6 changes: 6 additions & 0 deletions addon-test-support/ember-qunit/legacy-2-x/module-for-model.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { createModule } from './qunit-module';
import { TestModuleForModel } from 'ember-test-helpers';
import Ember from 'ember';

export default function moduleForModel(name, description, callbacks) {
Ember.deprecate(`The usage "moduleForModel" is deprecated. Please migrate the "${name}" module to the new test APIs.`, false, {
id: 'deprecate-legacy-apis',
until: '5.0.0',
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md'
});
createModule(TestModuleForModel, name, description, callbacks);
}
6 changes: 6 additions & 0 deletions addon-test-support/ember-qunit/legacy-2-x/module-for.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { createModule } from './qunit-module';
import { TestModule } from 'ember-test-helpers';
import Ember from 'ember';

export default function moduleFor(name, description, callbacks) {
Ember.deprecate(`The usage "moduleFor" is deprecated. Please migrate the "${name}" module to the new test APIs.`, false, {
id: 'deprecate-legacy-apis',
until: '5.0.0',
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md'
});
createModule(TestModule, name, description, callbacks);
}

0 comments on commit 247482d

Please sign in to comment.