@@ -8,6 +8,7 @@ import path from 'path'
8
8
import Debug from 'debug'
9
9
import commonPathPrefix from 'common-path-prefix'
10
10
import type { FSWatcher } from 'chokidar'
11
+ import { defaultSpecPattern } from '@packages/config'
11
12
import parseGlob from 'parse-glob'
12
13
import mm from 'micromatch'
13
14
import RandExp from 'randexp'
@@ -19,7 +20,6 @@ import type { DataContext } from '..'
19
20
import { toPosix } from '../util/file'
20
21
import type { FilePartsShape } from '@packages/graphql/src/schemaTypes/objectTypes/gql-FileParts'
21
22
import { STORIES_GLOB } from '.'
22
- import { getDefaultSpecPatterns } from '../util/config-options'
23
23
24
24
export type SpecWithRelativeRoot = FoundSpec & { relativeToCommonRoot : string }
25
25
@@ -198,7 +198,7 @@ export class ProjectDataSource {
198
198
this . ctx . coreData . app . relaunchBrowser = relaunchBrowser
199
199
}
200
200
201
- async specPatternsForTestingType ( projectRoot : string , testingType : Cypress . TestingType ) : Promise < {
201
+ async specPatterns ( ) : Promise < {
202
202
specPattern ?: string [ ]
203
203
excludeSpecPattern ?: string [ ]
204
204
} > {
@@ -207,8 +207,8 @@ export class ProjectDataSource {
207
207
const config = await this . getConfig ( )
208
208
209
209
return {
210
- specPattern : toArray ( config [ testingType ] ? .specPattern ) ,
211
- excludeSpecPattern : toArray ( config [ testingType ] ? .excludeSpecPattern ) ,
210
+ specPattern : toArray ( config . specPattern ) ,
211
+ excludeSpecPattern : toArray ( config . excludeSpecPattern ) ,
212
212
}
213
213
}
214
214
@@ -272,7 +272,7 @@ export class ProjectDataSource {
272
272
}
273
273
274
274
let specPatternSet : string | undefined
275
- const { specPattern = [ ] } = await this . ctx . project . specPatternsForTestingType ( this . ctx . currentProject , this . ctx . coreData . currentTestingType )
275
+ const { specPattern = [ ] } = await this . ctx . project . specPatterns ( )
276
276
277
277
if ( Array . isArray ( specPattern ) ) {
278
278
specPatternSet = specPattern [ 0 ]
@@ -301,7 +301,7 @@ export class ProjectDataSource {
301
301
302
302
const MINIMATCH_OPTIONS = { dot : true , matchBase : true }
303
303
304
- const { specPattern = [ ] , excludeSpecPattern = [ ] } = await this . ctx . project . specPatternsForTestingType ( this . ctx . currentProject , this . ctx . coreData . currentTestingType )
304
+ const { specPattern = [ ] , excludeSpecPattern = [ ] } = await this . ctx . project . specPatterns ( )
305
305
306
306
for ( const pattern of excludeSpecPattern ) {
307
307
if ( minimatch ( specFile , pattern , MINIMATCH_OPTIONS ) ) {
@@ -415,9 +415,9 @@ export class ProjectDataSource {
415
415
assert ( this . ctx . currentProject )
416
416
assert ( this . ctx . coreData . currentTestingType )
417
417
418
- const { e2e, component } = getDefaultSpecPatterns ( )
418
+ const { e2e, component } = defaultSpecPattern
419
419
420
- const { specPattern } = await this . ctx . project . specPatternsForTestingType ( this . ctx . currentProject , this . ctx . coreData . currentTestingType )
420
+ const { specPattern } = await this . ctx . project . specPatterns ( )
421
421
422
422
if ( this . ctx . coreData . currentTestingType === 'e2e' ) {
423
423
return isEqual ( specPattern , [ e2e ] )
0 commit comments