Skip to content

Commit 85dc12c

Browse files
committed
Adding test for cypress config filename set to false
1 parent fa44af7 commit 85dc12c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/unit/bin/helpers/capabilityHelper.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,37 @@ describe("capabilityHelper.js", () => {
734734
fs.readFileSync.restore();
735735
});
736736
});
737+
738+
context("cypress config file set to false", () => {
739+
beforeEach(function() {
740+
readFileSpy = sinon.stub(fs, 'readFileSync');
741+
jsonParseSpy = sinon.stub(JSON, 'parse');
742+
});
743+
744+
afterEach(function() {
745+
readFileSpy.restore();
746+
jsonParseSpy.restore();
747+
});
748+
749+
it("does not validate with cypress config filename set to false", () => {
750+
// sinon.stub(fs, 'existsSync').returns(false);
751+
bsConfig.run_settings.cypressConfigFilePath = 'false';
752+
bsConfig.run_settings.cypress_config_filename = 'false';
753+
754+
return capabilityHelper
755+
.validate(bsConfig, {})
756+
.then(function (data) {
757+
sinon.assert.notCalled(readFileSpy);
758+
sinon.assert.notCalled(jsonParseSpy);
759+
})
760+
.catch((error) => {
761+
chai.assert.equal(
762+
error,
763+
Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE
764+
);
765+
});
766+
})
767+
});
737768
});
738769
});
739770
});

0 commit comments

Comments
 (0)