10
10
import realGlob from 'fast-glob' ;
11
11
import { promises as fs } from 'fs' ;
12
12
import * as path from 'path' ;
13
- import { findTestFiles } from '../test-files' ;
14
- import { BASE_OPTIONS } from './options' ;
13
+ import { findTestFiles } from './test-files' ;
15
14
16
15
describe ( 'test-files' , ( ) => {
17
16
describe ( 'findTestFiles()' , ( ) => {
@@ -31,11 +30,8 @@ describe('test-files', () => {
31
30
await fs . writeFile ( path . join ( tempDir , 'nested' , 'bar.spec.ts' ) , '' ) ;
32
31
33
32
const testFiles = await findTestFiles (
34
- {
35
- ...BASE_OPTIONS ,
36
- include : [ '**/*.spec.ts' ] ,
37
- exclude : [ ] ,
38
- } ,
33
+ [ '**/*.spec.ts' ] /* include */ ,
34
+ [ ] /* exclude */ ,
39
35
tempDir ,
40
36
) ;
41
37
@@ -49,11 +45,8 @@ describe('test-files', () => {
49
45
await fs . writeFile ( path . join ( tempDir , 'node_modules' , 'dep' , 'baz.spec.ts' ) , '' ) ;
50
46
51
47
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 */ ,
57
50
tempDir ,
58
51
) ;
59
52
@@ -71,12 +64,9 @@ describe('test-files', () => {
71
64
await fs . writeFile ( path . join ( tempDir , 'node_modules' , 'dep' , 'baz.test.ts' ) , '' ) ;
72
65
73
66
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 */ ,
80
70
tempDir ,
81
71
) ;
82
72
@@ -89,10 +79,8 @@ describe('test-files', () => {
89
79
await fs . writeFile ( path . join ( tempDir , 'nested' , 'bar.spec.ts' ) , '' ) ;
90
80
91
81
const testFiles = await findTestFiles (
92
- {
93
- ...BASE_OPTIONS ,
94
- include : [ '**/*.spec.ts' ] ,
95
- } ,
82
+ [ '**/*.spec.ts' ] /* include */ ,
83
+ [ ] /* exclude */ ,
96
84
path . join ( tempDir , 'nested' ) ,
97
85
) ;
98
86
@@ -111,10 +99,8 @@ describe('test-files', () => {
111
99
112
100
await expectAsync (
113
101
findTestFiles (
114
- {
115
- ...BASE_OPTIONS ,
116
- include : [ '*.spec.ts' , '*.stuff.ts' , '*.test.ts' ] ,
117
- } ,
102
+ [ '*.spec.ts' , '*.stuff.ts' , '*.test.ts' ] /* include */ ,
103
+ [ ] /* exclude */ ,
118
104
tempDir ,
119
105
// eslint-disable-next-line @typescript-eslint/no-explicit-any
120
106
glob as any ,
@@ -127,10 +113,8 @@ describe('test-files', () => {
127
113
await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' ) , '' ) ;
128
114
129
115
const testFiles = await findTestFiles (
130
- {
131
- ...BASE_OPTIONS ,
132
- include : [ '{foo,bar}.spec.ts' ] ,
133
- } ,
116
+ [ '{foo,bar}.spec.ts' ] /* include */ ,
117
+ [ ] /* exclude */ ,
134
118
tempDir ,
135
119
) ;
136
120
@@ -142,10 +126,8 @@ describe('test-files', () => {
142
126
await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' ) , '' ) ;
143
127
144
128
const testFiles = await findTestFiles (
145
- {
146
- ...BASE_OPTIONS ,
147
- include : [ '+(foo|bar).spec.ts' ] ,
148
- } ,
129
+ [ '+(foo|bar).spec.ts' ] /* include */ ,
130
+ [ ] /* exclude */ ,
149
131
tempDir ,
150
132
) ;
151
133
@@ -158,10 +140,8 @@ describe('test-files', () => {
158
140
await fs . writeFile ( path . join ( tempDir , 'bar.spec.ts' , 'baz.spec.ts' ) , '' ) ;
159
141
160
142
const testFiles = await findTestFiles (
161
- {
162
- ...BASE_OPTIONS ,
163
- include : [ '**/*.spec.ts' ] ,
164
- } ,
143
+ [ '**/*.spec.ts' ] /* include */ ,
144
+ [ ] /* exclude */ ,
165
145
tempDir ,
166
146
) ;
167
147
0 commit comments