File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 6
6
*
7
7
*/
8
8
9
- import { statement } from '../../../tests/utils' ;
9
+ import { statement , noopImporter } from '../../../tests/utils' ;
10
10
import isExportsOrModuleAssignment from '../isExportsOrModuleAssignment' ;
11
11
12
12
describe ( 'isExportsOrModuleAssignment' , ( ) => {
13
13
it ( 'detects "module.exports = ...;"' , ( ) => {
14
14
expect (
15
- isExportsOrModuleAssignment ( statement ( 'module.exports = foo;' ) ) ,
15
+ isExportsOrModuleAssignment (
16
+ statement ( 'module.exports = foo;' ) ,
17
+ noopImporter ,
18
+ ) ,
16
19
) . toBe ( true ) ;
17
20
} ) ;
18
21
19
22
it ( 'detects "exports.foo = ..."' , ( ) => {
20
- expect ( isExportsOrModuleAssignment ( statement ( 'exports.foo = foo;' ) ) ) . toBe (
21
- true ,
22
- ) ;
23
+ expect (
24
+ isExportsOrModuleAssignment (
25
+ statement ( 'exports.foo = foo;' ) ,
26
+ noopImporter ,
27
+ ) ,
28
+ ) . toBe ( true ) ;
23
29
} ) ;
24
30
25
31
it ( 'does not accept "exports = foo;"' , ( ) => {
26
32
// That doesn't actually export anything
27
- expect ( isExportsOrModuleAssignment ( statement ( 'exports = foo;' ) ) ) . toBe (
28
- false ,
29
- ) ;
33
+ expect (
34
+ isExportsOrModuleAssignment ( statement ( 'exports = foo;' ) , noopImporter ) ,
35
+ ) . toBe ( false ) ;
30
36
} ) ;
31
37
} ) ;
You can’t perform that action at this time.
0 commit comments