forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreexports_test.js
36 lines (31 loc) · 1.13 KB
/
reexports_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Ember from 'ember';
import { confirmExport, testUnless } from 'internal-test-helpers';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
import * as emberTesting from 'ember-testing';
import { DEPRECATIONS } from '@ember/-internals/deprecations';
class ReexportsTestCase extends AbstractTestCase {}
[
// ember-testing
['Test', 'ember-testing'],
['Test.Adapter', 'ember-testing', 'Adapter'],
['Test.QUnitAdapter', 'ember-testing', 'QUnitAdapter'],
['setupForTesting', 'ember-testing'],
].forEach((reexport) => {
let [path, moduleId, exportName] = reexport;
// default path === exportName if none present
if (!exportName) {
exportName = path;
}
ReexportsTestCase.prototype[
`${testUnless(
DEPRECATIONS.DEPRECATE_IMPORT_EMBER(path).isRemoved
)} Ember.${path} exports correctly`
] = function (assert) {
expectDeprecation(
/'ember' barrel file is deprecated/,
DEPRECATIONS.DEPRECATE_IMPORT_EMBER(path || exportName).isEnabled
);
confirmExport(Ember, assert, path, moduleId, exportName, emberTesting);
};
});
moduleFor('ember-testing reexports', ReexportsTestCase);