Skip to content

Commit d8bd069

Browse files
committed
Resolved tests failing because of cypress.json validation
1 parent 23f13d7 commit d8bd069

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/unit/bin/helpers/capabilityHelper.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const chai = require("chai"),
2-
chaiAsPromised = require("chai-as-promised");
2+
chaiAsPromised = require("chai-as-promised"),
3+
fs = require('fs'),
4+
sinon = require('sinon');
35

46
const capabilityHelper = require("../../../../bin/helpers/capabilityHelper"),
57
Constants = require("../../../../bin/helpers/constants"),
@@ -253,6 +255,10 @@ describe("capabilityHelper.js", () => {
253255

254256
describe("validate parallels specified in bsconfig and arguments", () => {
255257
beforeEach(() => {
258+
//Stub for cypress json validation
259+
sinon.stub(fs, 'existsSync').returns(true);
260+
sinon.stub(fs, 'readFileSync').returns("{}");
261+
256262
bsConfig = {
257263
auth: {},
258264
browsers: [
@@ -268,6 +274,11 @@ describe("capabilityHelper.js", () => {
268274
};
269275
});
270276

277+
afterEach(() => {
278+
fs.existsSync.restore();
279+
fs.readFileSync.restore();
280+
});
281+
271282
it("validate parallels present in arguments (not a number) when specified (valid) in bsconfig run_settings", () => {
272283
bsConfig.run_settings.parallels = 10;
273284
return capabilityHelper

0 commit comments

Comments
 (0)