Skip to content

Commit c27964a

Browse files
authored
Deprecate legacy test APIs (#483)
Deprecate legacy test APIs
2 parents ce02294 + 6e4d155 commit c27964a

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { createModule } from './qunit-module';
22
import { TestModuleForComponent } from 'ember-test-helpers';
3+
import { deprecate } from '@ember/application/deprecations';
34

45
export default function moduleForComponent(name, description, callbacks) {
56
createModule(TestModuleForComponent, name, description, callbacks);
7+
deprecate(
8+
`The usage "moduleForComponent" is deprecated. Please migrate the "${name}" module to use "setupRenderingTest".`,
9+
false,
10+
{
11+
id: 'ember-qunit.deprecate-legacy-apis',
12+
until: '5.0.0',
13+
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md',
14+
}
15+
);
616
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { createModule } from './qunit-module';
22
import { TestModuleForModel } from 'ember-test-helpers';
3+
import { deprecate } from '@ember/application/deprecations';
34

45
export default function moduleForModel(name, description, callbacks) {
6+
deprecate(
7+
`The usage "moduleForModel" is deprecated. Please migrate the "${name}" module to the new test APIs.`,
8+
false,
9+
{
10+
id: 'ember-qunit.deprecate-legacy-apis',
11+
until: '5.0.0',
12+
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md',
13+
}
14+
);
515
createModule(TestModuleForModel, name, description, callbacks);
616
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { createModule } from './qunit-module';
22
import { TestModule } from 'ember-test-helpers';
3+
import { deprecate } from '@ember/application/deprecations';
34

45
export default function moduleFor(name, description, callbacks) {
6+
deprecate(
7+
`The usage "moduleFor" is deprecated. Please migrate the "${name}" module to use "module"`,
8+
false,
9+
{
10+
id: 'ember-qunit.deprecate-legacy-apis',
11+
until: '5.0.0',
12+
url: 'https://github.com/emberjs/ember-qunit/blob/master/docs/migration.md',
13+
}
14+
);
515
createModule(TestModule, name, description, callbacks);
616
}

0 commit comments

Comments
 (0)