File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -163,24 +163,19 @@ exports.getTestEnv = () => {
163
163
}
164
164
165
165
exports . getFileSeparatorData = ( ) => {
166
- const fileSeparatorRegex = / ^ w i n / . test ( process . platform ) ? "\\" : "/" ;
167
- const fileSeparator = / ^ w i n / . test ( process . platform ) ? "\\" : "/" ;
168
- return {
169
- fileSeparator,
170
- fileSeparatorRegex
171
- } ;
166
+ return / ^ w i n / . test ( process . platform ) ? "\\" : "/" ;
172
167
}
173
168
174
169
exports . findGitConfig = ( filePath ) => {
175
- const { fileSeparator, fileSeparatorRegex } = exports . getFileSeparatorData ( ) ;
170
+ const fileSeparator = exports . getFileSeparatorData ( ) ;
176
171
if ( filePath == null || filePath == '' || filePath == fileSeparator ) {
177
172
return null ;
178
173
}
179
174
try {
180
175
fs . statSync ( filePath + fileSeparator + '.git' + fileSeparator + 'config' ) ;
181
176
return filePath ;
182
177
} catch ( e ) {
183
- let parentFilePath = filePath . split ( fileSeparatorRegex ) ;
178
+ let parentFilePath = filePath . split ( fileSeparator ) ;
184
179
parentFilePath . pop ( ) ;
185
180
return exports . findGitConfig ( parentFilePath . join ( fileSeparator ) ) ;
186
181
}
Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ class MyReporter {
284
284
if ( ! isBrowserstackInfra ( ) ) gitConfigPath = process . env . OBSERVABILITY_GIT_CONFIG_PATH_LOCAL ? process . env . OBSERVABILITY_GIT_CONFIG_PATH_LOCAL . toString ( ) : null ;
285
285
const prefixedTestPath = rootParentFile ? this . _paths . prefixTestPath ( rootParentFile ) : 'File path could not be found' ;
286
286
287
- const { fileSeparator, fileSeparatorRegex } = getFileSeparatorData ( ) ;
287
+ const fileSeparator = getFileSeparatorData ( ) ;
288
288
289
289
let testData = {
290
290
'framework' : 'Cypress' ,
You can’t perform that action at this time.
0 commit comments