1010import realGlob from 'fast-glob' ;
1111import { promises as fs } from 'fs' ;
1212import * as path from 'path' ;
13- import { findTestFiles } from '../test-files' ;
14- import { BASE_OPTIONS } from './options' ;
13+ import { findTestFiles } from './test-files' ;
1514
1615describe ( 'test-files' , ( ) => {
1716 describe ( 'findTestFiles()' , ( ) => {
@@ -31,11 +30,8 @@ describe('test-files', () => {
3130 await fs . writeFile ( path . join ( tempDir , 'nested' , 'bar.spec.ts' ) , '' ) ;
3231
3332 const testFiles = await findTestFiles (
34- {
35- ...BASE_OPTIONS ,
36- include : [ '**/*.spec.ts' ] ,
37- exclude : [ ] ,
38- } ,
33+ [ '**/*.spec.ts' ] /* include */ ,
34+ [ ] /* exclude */ ,
3935 tempDir ,
4036 ) ;
4137
@@ -49,11 +45,8 @@ describe('test-files', () => {
4945 await fs . writeFile ( path . join ( tempDir , 'node_modules' , 'dep' , 'baz.spec.ts' ) , '' ) ;
5046
5147 const testFiles = await findTestFiles (
52- {
53- ...BASE_OPTIONS ,
54- include : [ '**/*.spec.ts' ] ,
55- exclude : [ '**/*.ignored.spec.ts' ] ,
56- } ,
48+ [ '**/*.spec.ts' ] /* include */ ,
49+ [ '**/*.ignored.spec.ts' ] /* exclude */ ,
5750 tempDir ,
5851 ) ;
5952
@@ -71,12 +64,9 @@ describe('test-files', () => {
7164 await fs . writeFile ( path . join ( tempDir , 'node_modules' , 'dep' , 'baz.test.ts' ) , '' ) ;
7265
7366 const testFiles = await findTestFiles (
74- {
75- ...BASE_OPTIONS ,
76- include : [ '**/*.spec.ts' , '**/*.test.ts' ] ,
77- // Exclude should be applied to all `glob()` executions.
78- exclude : [ '**/*.ignored.*.ts' ] ,
79- } ,
67+ [ '**/*.spec.ts' , '**/*.test.ts' ] /* include */ ,
68+ // Exclude should be applied to all `glob()` executions.
69+ [ '**/*.ignored.*.ts' ] /* exclude */ ,
8070 tempDir ,
8171 ) ;
8272
@@ -89,10 +79,8 @@ describe('test-files', () => {
8979 await fs . writeFile ( path . join ( tempDir , 'nested' , 'bar.spec.ts' ) , '' ) ;
9080
9181 const testFiles = await findTestFiles (
92- {
93- ...BASE_OPTIONS ,
94- include : [ '**/*.spec.ts' ] ,
95- } ,
82+ [ '**/*.spec.ts' ] /* include */ ,
83+ [ ] /* exclude */ ,
9684 path . join ( tempDir , 'nested' ) ,
9785 ) ;
9886
@@ -111,10 +99,8 @@ describe('test-files', () => {
11199
112100 await expectAsync (
113101 findTestFiles (
114- {
115- ...BASE_OPTIONS ,
116- include : [ '*.spec.ts' , '*.stuff.ts' , '*.test.ts' ] ,
117- } ,
102+ [ '*.spec.ts' , '*.stuff.ts' , '*.test.ts' ] /* include */ ,
103+ [ ] /* exclude */ ,
118104 tempDir ,
119105 // eslint-disable-next-line @typescript-eslint/no-explicit-any
120106 glob as any ,
@@ -127,10 +113,8 @@ describe('test-files', () => {
127113 await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' ) , '' ) ;
128114
129115 const testFiles = await findTestFiles (
130- {
131- ...BASE_OPTIONS ,
132- include : [ '{foo,bar}.spec.ts' ] ,
133- } ,
116+ [ '{foo,bar}.spec.ts' ] /* include */ ,
117+ [ ] /* exclude */ ,
134118 tempDir ,
135119 ) ;
136120
@@ -142,10 +126,8 @@ describe('test-files', () => {
142126 await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' ) , '' ) ;
143127
144128 const testFiles = await findTestFiles (
145- {
146- ...BASE_OPTIONS ,
147- include : [ '+(foo|bar).spec.ts' ] ,
148- } ,
129+ [ '+(foo|bar).spec.ts' ] /* include */ ,
130+ [ ] /* exclude */ ,
149131 tempDir ,
150132 ) ;
151133
@@ -158,10 +140,8 @@ describe('test-files', () => {
158140 await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' , 'baz.spec.ts' ) , '' ) ;
159141
160142 const testFiles = await findTestFiles (
161- {
162- ...BASE_OPTIONS ,
163- include : [ '**/*.spec.ts' ] ,
164- } ,
143+ [ '**/*.spec.ts' ] /* include */ ,
144+ [ ] /* exclude */ ,
165145 tempDir ,
166146 ) ;
167147
0 commit comments