Skip to content

Commit

Permalink
Deprecate legacy test APIs (#483)
Browse files Browse the repository at this point in the history
Deprecate legacy test APIs
  • Loading branch information
rwjblue committed May 9, 2019
2 parents ce02294 + 6e4d155 commit c27964a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addon-test-support/ember-qunit/legacy-2-x/module-for-component.js
@@ -1,6 +1,16 @@
import { createModule } from './qunit-module';
import { TestModuleForComponent } from 'ember-test-helpers';
import { deprecate } from '@ember/application/deprecations';

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

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

export default function moduleFor(name, description, callbacks) {
deprecate(
`The usage "moduleFor" is deprecated. Please migrate the "${name}" module to use "module"`,
false,
{
id: 'ember-qunit.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 c27964a

Please sign in to comment.