File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -734,6 +734,37 @@ describe("capabilityHelper.js", () => {
734
734
fs . readFileSync . restore ( ) ;
735
735
} ) ;
736
736
} ) ;
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
+ } ) ;
737
768
} ) ;
738
769
} ) ;
739
770
} ) ;
You can’t perform that action at this time.
0 commit comments