@@ -16,7 +16,7 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => {
16
16
logger . info ( `Creating tests.zip with files in ${ cypressFolderPath } ` ) ;
17
17
18
18
var archive = archiver ( 'zip' , {
19
- zlib : { level : 9 } // Sets the compression level.
19
+ zlib : { level : 9 } , // Sets the compression level.
20
20
} ) ;
21
21
22
22
archive . on ( 'warning' , function ( err ) {
@@ -28,7 +28,7 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => {
28
28
} ) ;
29
29
30
30
output . on ( 'close' , function ( ) {
31
- resolve ( " Zipping completed" ) ;
31
+ resolve ( ' Zipping completed' ) ;
32
32
} ) ;
33
33
34
34
output . on ( 'end' , function ( ) {
@@ -43,9 +43,7 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => {
43
43
44
44
let ignoreFiles = getFilesToIgnore ( runSettings , excludeFiles ) ;
45
45
46
- Constants . allowedFileTypes . forEach ( fileType => {
47
- archive . glob ( `**/*.${ fileType } ` , { cwd : cypressFolderPath , matchBase : true , ignore : ignoreFiles , dot :true } ) ;
48
- } ) ;
46
+ archive . glob ( `**/*.+(${ Constants . allowedFileTypes . join ( "|" ) } )` , { cwd : cypressFolderPath , matchBase : true , ignore : ignoreFiles , dot :true } ) ;
49
47
50
48
let packageJSON = { } ;
51
49
@@ -54,19 +52,26 @@ const archiveSpecs = (runSettings, filePath, excludeFiles) => {
54
52
}
55
53
56
54
if ( typeof runSettings . npm_dependencies === 'object' ) {
57
- Object . assign ( packageJSON , { devDependencies : runSettings . npm_dependencies } ) ;
55
+ Object . assign ( packageJSON , {
56
+ devDependencies : runSettings . npm_dependencies ,
57
+ } ) ;
58
58
}
59
59
60
60
if ( Object . keys ( packageJSON ) . length > 0 ) {
61
61
let packageJSONString = JSON . stringify ( packageJSON , null , 4 ) ;
62
- archive . append ( packageJSONString , { name : 'browserstack-package.json' } ) ;
62
+ archive . append ( packageJSONString , { name : 'browserstack-package.json' } ) ;
63
63
}
64
64
65
65
// do not add cypress.json if arg provided is false
66
- if ( runSettings . cypress_config_file && runSettings . cypress_config_filename !== 'false' ) {
67
- let cypressJSON = JSON . parse ( fs . readFileSync ( runSettings . cypressConfigFilePath ) ) ;
66
+ if (
67
+ runSettings . cypress_config_file &&
68
+ runSettings . cypress_config_filename !== 'false'
69
+ ) {
70
+ let cypressJSON = JSON . parse (
71
+ fs . readFileSync ( runSettings . cypressConfigFilePath )
72
+ ) ;
68
73
let cypressJSONString = JSON . stringify ( cypressJSON , null , 4 ) ;
69
- archive . append ( cypressJSONString , { name : 'cypress.json' } ) ;
74
+ archive . append ( cypressJSONString , { name : 'cypress.json' } ) ;
70
75
}
71
76
72
77
archive . finalize ( ) ;
0 commit comments