Skip to content

Commit 924fd74

Browse files
07souravkundafrancisf
authored andcommitted
fix test files
1 parent f0e8992 commit 924fd74

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

bin/helpers/packageInstaller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const packageInstall = (packageDir) => {
6565
resolve('Packages were installed successfully.');
6666
} else {
6767
logger.error(`Some error occurred while installing packages. Error code ${code}`);
68-
reject('Packages were not installed successfully. Error code ${code}');
68+
reject(`Packages were not installed successfully. Error code ${code}`);
6969
}
7070
};
7171
const nodeProcessErrorCallback = (error) => {

bin/helpers/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressJson) => {
857857
let globSearchPattern = this.sanitizeSpecsPattern(bsConfig.run_settings.specs) || `${testFolderPath}/**/*.+(${Constants.specFileTypes.join("|")})`;
858858
let ignoreFiles = args.exclude || bsConfig.run_settings.exclude;
859859
let files = glob.sync(globSearchPattern, {cwd: bsConfig.run_settings.cypressProjectDir, matchBase: true, ignore: ignoreFiles});
860-
logger.debug(`${files.length} spec files found at ${testFolderPath}`);
860+
logger.debug(`${files ? files.length : 0} spec files found at ${testFolderPath}`);
861861
return files;
862862
};
863863

test/unit/bin/commands/runs.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ describe("runs", () => {
2121

2222
beforeEach(() => {
2323
sandbox = sinon.createSandbox();
24+
setDebugModeStub = sandbox.stub();
2425
validateBstackJsonStub = sandbox.stub();
2526
getConfigPathStub = sandbox.stub();
2627
setUsageReportingFlagStub = sandbox.stub().returns(undefined);
@@ -50,7 +51,8 @@ describe("runs", () => {
5051
setUsageReportingFlag: setUsageReportingFlagStub,
5152
getConfigPath: getConfigPathStub,
5253
deleteResults: deleteResultsStub,
53-
readBsConfigJSON: readBsConfigJSONStub
54+
readBsConfigJSON: readBsConfigJSONStub,
55+
setDebugMode: setDebugModeStub
5456
},
5557
});
5658

@@ -158,7 +160,8 @@ describe("runs", () => {
158160
setConfig: setConfigStub,
159161
setCLIMode: setCLIModeStub,
160162
setGeolocation: setGeolocationStub,
161-
setSpecTimeout: setSpecTimeoutStub
163+
setSpecTimeout: setSpecTimeoutStub,
164+
setDebugMode: setDebugModeStub
162165
},
163166
'../helpers/capabilityHelper': {
164167
validate: capabilityValidatorStub
@@ -302,7 +305,8 @@ describe("runs", () => {
302305
setCLIMode: setCLIModeStub,
303306
setGeolocation: setGeolocationStub,
304307
getVideoConfig: getVideoConfigStub,
305-
setSpecTimeout: setSpecTimeoutStub
308+
setSpecTimeout: setSpecTimeoutStub,
309+
setDebugMode: setDebugModeStub
306310
},
307311
'../helpers/capabilityHelper': {
308312
validate: capabilityValidatorStub,
@@ -468,7 +472,8 @@ describe("runs", () => {
468472
fetchZipSize: fetchZipSizeStub,
469473
setGeolocation: setGeolocationStub,
470474
getVideoConfig: getVideoConfigStub,
471-
setSpecTimeout: setSpecTimeoutStub
475+
setSpecTimeout: setSpecTimeoutStub,
476+
setDebugMode: setDebugModeStub
472477
},
473478
'../helpers/capabilityHelper': {
474479
validate: capabilityValidatorStub,
@@ -642,7 +647,8 @@ describe("runs", () => {
642647
fetchZipSize: fetchZipSizeStub,
643648
setGeolocation: setGeolocationStub,
644649
getVideoConfig: getVideoConfigStub,
645-
setSpecTimeout: setSpecTimeoutStub
650+
setSpecTimeout: setSpecTimeoutStub,
651+
setDebugMode: setDebugModeStub
646652
},
647653
'../helpers/capabilityHelper': {
648654
validate: capabilityValidatorStub,
@@ -849,7 +855,8 @@ describe("runs", () => {
849855
fetchZipSize: fetchZipSizeStub,
850856
setGeolocation: setGeolocationStub,
851857
getVideoConfig: getVideoConfigStub,
852-
setSpecTimeout: setSpecTimeoutStub
858+
setSpecTimeout: setSpecTimeoutStub,
859+
setDebugMode: setDebugModeStub
853860
},
854861
'../helpers/capabilityHelper': {
855862
validate: capabilityValidatorStub,

test/unit/bin/helpers/packageInstaller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ describe("packageInstaller", () => {
312312
return archiverStub;
313313
},
314314
logger: {
315-
info: winstonLoggerInfoStub
315+
info: winstonLoggerInfoStub,
316+
debug: winstonLoggerInfoStub
316317
}
317318
});
318319
let packageArchiverrewire = packageInstaller.__get__('packageArchiver');

0 commit comments

Comments
 (0)