@@ -2,7 +2,6 @@ import type { TSESTree } from '@typescript-eslint/utils';
2
2
import dedent from 'dedent' ;
3
3
import {
4
4
FlatCompatRuleTester as RuleTester ,
5
- eslintMajorVersion ,
6
5
espreeParser ,
7
6
} from '../../__tests__/test-utils' ;
8
7
import {
@@ -445,82 +444,80 @@ ruleTester.run('esm', rule, {
445
444
invalid : [ ] ,
446
445
} ) ;
447
446
448
- if ( eslintMajorVersion >= 8 ) {
449
- ruleTester . run ( 'esm (dynamic)' , rule , {
450
- valid : [
451
- {
452
- code : dedent `
453
- const { it } = await import('./test-utils');
447
+ ruleTester . run ( 'esm (dynamic)' , rule , {
448
+ valid : [
449
+ {
450
+ code : dedent `
451
+ const { it } = await import('./test-utils');
454
452
455
- it('is not a jest function', () => {});
456
- ` ,
457
- parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
458
- } ,
459
- {
460
- code : dedent `
461
- const { it } = await import(\`./test-utils\`);
453
+ it('is not a jest function', () => {});
454
+ ` ,
455
+ parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
456
+ } ,
457
+ {
458
+ code : dedent `
459
+ const { it } = await import(\`./test-utils\`);
462
460
463
- it('is not a jest function', () => {});
464
- ` ,
465
- parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
466
- } ,
467
- ] ,
468
- invalid : [
469
- {
470
- code : dedent `
471
- const { it } = await import("@jest/globals");
472
-
473
- it('is a jest function', () => {});
474
- ` ,
475
- parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
476
- errors : [
477
- {
478
- messageId : 'details' ,
479
- data : expectedParsedJestFnCallResultData ( {
480
- name : 'it' ,
481
- type : 'test' ,
482
- head : {
483
- original : 'it' ,
484
- local : 'it' ,
485
- type : 'import' ,
486
- node : 'it' ,
487
- } ,
488
- members : [ ] ,
489
- } ) ,
490
- column : 1 ,
491
- line : 3 ,
492
- } ,
493
- ] ,
494
- } ,
495
- {
496
- code : dedent `
497
- const { it } = await import(\`@jest/globals\`);
498
-
499
- it('is a jest function', () => {});
500
- ` ,
501
- parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
502
- errors : [
503
- {
504
- messageId : 'details' ,
505
- data : expectedParsedJestFnCallResultData ( {
506
- name : 'it' ,
507
- type : 'test' ,
508
- head : {
509
- original : 'it' ,
510
- local : 'it' ,
511
- type : 'import' ,
512
- node : 'it' ,
513
- } ,
514
- members : [ ] ,
515
- } ) ,
516
- column : 1 ,
517
- line : 3 ,
518
- } ,
519
- ] ,
520
- } ,
521
- ] ,
522
- } ) ;
523
- }
461
+ it('is not a jest function', () => {});
462
+ ` ,
463
+ parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
464
+ } ,
465
+ ] ,
466
+ invalid : [
467
+ {
468
+ code : dedent `
469
+ const { it } = await import("@jest/globals");
470
+
471
+ it('is a jest function', () => {});
472
+ ` ,
473
+ parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
474
+ errors : [
475
+ {
476
+ messageId : 'details' ,
477
+ data : expectedParsedJestFnCallResultData ( {
478
+ name : 'it' ,
479
+ type : 'test' ,
480
+ head : {
481
+ original : 'it' ,
482
+ local : 'it' ,
483
+ type : 'import' ,
484
+ node : 'it' ,
485
+ } ,
486
+ members : [ ] ,
487
+ } ) ,
488
+ column : 1 ,
489
+ line : 3 ,
490
+ } ,
491
+ ] ,
492
+ } ,
493
+ {
494
+ code : dedent `
495
+ const { it } = await import(\`@jest/globals\`);
496
+
497
+ it('is a jest function', () => {});
498
+ ` ,
499
+ parserOptions : { sourceType : 'module' , ecmaVersion : 2022 } ,
500
+ errors : [
501
+ {
502
+ messageId : 'details' ,
503
+ data : expectedParsedJestFnCallResultData ( {
504
+ name : 'it' ,
505
+ type : 'test' ,
506
+ head : {
507
+ original : 'it' ,
508
+ local : 'it' ,
509
+ type : 'import' ,
510
+ node : 'it' ,
511
+ } ,
512
+ members : [ ] ,
513
+ } ) ,
514
+ column : 1 ,
515
+ line : 3 ,
516
+ } ,
517
+ ] ,
518
+ } ,
519
+ ] ,
520
+ } ) ;
524
521
525
522
ruleTester . run ( 'cjs' , rule , {
526
523
valid : [
0 commit comments