@@ -854,32 +854,40 @@ describe('lib/cypress', () => {
854854 } )
855855 } )
856856
857- it ( 'logs error and exits when spec file was specified and does not exist' , function ( ) {
858- return cypress . start ( [ `--run-project=${ this . todosPath } ` , '--spec=path/to/spec' ] )
859- . then ( ( ) => {
860- this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'path/to/spec' )
861- this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'We searched for any files matching this glob pattern:' )
857+ describe ( 'no specs found' , function ( ) {
858+ it ( 'logs error and exits when spec file was specified and does not exist' , function ( ) {
859+ return cypress . start ( [ `--run-project=${ this . todosPath } ` , '--spec=path/to/spec' ] )
860+ . then ( ( ) => {
861+ // includes the search spec
862+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'path/to/spec' )
863+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'We searched for any files matching this glob pattern:' )
864+ // includes the project path
865+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , this . todosPath )
866+ } )
862867 } )
863- } )
864868
865- it ( 'logs error and exits when spec absolute file was specified and does not exist' , function ( ) {
866- return cypress . start ( [
867- `--run-project=${ this . todosPath } ` ,
868- `--spec=${ this . todosPath } /tests/path/to/spec` ,
869- ] )
870- . then ( ( ) => {
871- this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'tests/path/to/spec' )
869+ it ( 'logs error and exits when spec absolute file was specified and does not exist' , function ( ) {
870+ return cypress . start ( [
871+ `--run-project=${ this . todosPath } ` ,
872+ `--spec=${ this . todosPath } /tests/path/to/spec` ,
873+ ] )
874+ . then ( ( ) => {
875+ // includes path to the spec
876+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'tests/path/to/spec' )
877+ // includes folder name
878+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , this . todosPath )
879+ } )
872880 } )
873- } )
874881
875- it ( 'logs error and exits when no specs were found at all' , function ( ) {
876- return cypress . start ( [
877- `--run-project=${ this . todosPath } ` ,
878- '--config=integrationFolder=cypress/specs' ,
879- ] )
880- . then ( ( ) => {
881- this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'We searched for any files inside of this folder:' )
882- this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'cypress/specs' )
882+ it ( 'logs error and exits when no specs were found at all' , function ( ) {
883+ return cypress . start ( [
884+ `--run-project=${ this . todosPath } ` ,
885+ '--config=integrationFolder=cypress/specs' ,
886+ ] )
887+ . then ( ( ) => {
888+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'We searched for any files inside of this folder:' )
889+ this . expectExitWithErr ( 'NO_SPECS_FOUND' , 'cypress/specs' )
890+ } )
883891 } )
884892 } )
885893
0 commit comments