1- import Debug from ' debug' ;
1+ import Debug from " debug" ;
22
3- import { P , match } from ' ts-pattern' ;
4- import { DetectedBrowser , ValidatedCurrentsParameters } from ' ../../types' ;
5- import { bootCypress } from ' ../bootstrap' ;
6- import { info , warn } from ' ../log' ;
7- import { getConfigFilePath } from ' ./path' ;
3+ import { P , match } from " ts-pattern" ;
4+ import { DetectedBrowser , ValidatedCurrentsParameters } from " ../../types" ;
5+ import { bootCypress } from " ../bootstrap" ;
6+ import { info , warn } from " ../log" ;
7+ import { getConfigFilePath } from " ./path" ;
88
9- const debug = Debug ( ' currents:config' ) ;
9+ const debug = Debug ( " currents:config" ) ;
1010
1111export type E2EConfig = {
1212 batchSize : number ;
@@ -45,13 +45,13 @@ const defaultConfig: CurrentsConfig = {
4545 component : {
4646 batchSize : 5 ,
4747 } ,
48- cloudServiceUrl : ' https://cy.currents.dev' ,
48+ cloudServiceUrl : " https://cy.currents.dev" ,
4949 networkHeaders : undefined ,
5050} ;
5151
5252export async function getCurrentsConfig (
5353 projectRoot ?: string ,
54- explicitConfigFilePath ?: string
54+ explicitConfigFilePath ?: string ,
5555) : Promise < CurrentsConfig > {
5656 if ( _config ) {
5757 return _config ;
@@ -76,7 +76,10 @@ export async function getCurrentsConfig(
7676 }
7777 }
7878
79- warn ( 'Failed to load config file, falling back to the default config. Attempted locations: %s' , configFilePath ) ;
79+ warn (
80+ "Failed to load config file, falling back to the default config. Attempted locations: %s" ,
81+ configFilePath ,
82+ ) ;
8083 _config = defaultConfig ;
8184 return _config ;
8285}
@@ -86,14 +89,14 @@ async function loadConfigFile(filepath: string) {
8689 debug ( "loading currents config file from '%s'" , filepath ) ;
8790 return await import ( filepath ) ;
8891 } catch ( e ) {
89- debug ( ' failed loading config file from: %s' , e ) ;
92+ debug ( " failed loading config file from: %s" , e ) ;
9093 return null ;
9194 }
9295}
9396
9497export type MergedConfig = Awaited < ReturnType < typeof getMergedConfig > > ;
9598export async function getMergedConfig ( params : ValidatedCurrentsParameters ) {
96- debug ( ' resolving cypress config' ) ;
99+ debug ( " resolving cypress config" ) ;
97100 const cypressResolvedConfig :
98101 | ( Cypress . ResolvedConfigOptions & {
99102 projectRoot : string ;
@@ -102,12 +105,12 @@ export async function getMergedConfig(params: ValidatedCurrentsParameters) {
102105 } )
103106 | undefined = await bootCypress ( params ) ;
104107
105- debug ( ' cypress resolvedConfig: %O' , cypressResolvedConfig ) ;
108+ debug ( " cypress resolvedConfig: %O" , cypressResolvedConfig ) ;
106109
107110 // @ts -ignore
108111 const rawE2EPattern = cypressResolvedConfig . rawJson ?. e2e ?. specPattern ;
109112 let additionalIgnorePattern : string [ ] = [ ] ;
110- if ( params . testingType === ' component' && rawE2EPattern ) {
113+ if ( params . testingType === " component" && rawE2EPattern ) {
111114 // @ts -ignore
112115 additionalIgnorePattern = rawE2EPattern ;
113116 }
@@ -117,14 +120,14 @@ export async function getMergedConfig(params: ValidatedCurrentsParameters) {
117120 const result = {
118121 projectRoot : cypressResolvedConfig ?. projectRoot || process . cwd ( ) ,
119122 projectId : params . projectId ,
120- specPattern : cypressResolvedConfig ?. specPattern || ' **/*.*' ,
123+ specPattern : cypressResolvedConfig ?. specPattern || " **/*.*" ,
121124 excludeSpecPattern :
122125 // @ts -ignore
123126 cypressResolvedConfig ?. resolved . excludeSpecPattern . value ?? [ ] ,
124127 additionalIgnorePattern,
125128 resolved : cypressResolvedConfig ,
126129 experimentalCoverageRecording : params . experimentalCoverageRecording ,
127130 } ;
128- debug ( ' merged config: %O' , result ) ;
131+ debug ( " merged config: %O" , result ) ;
129132 return result ;
130133}
0 commit comments