@@ -3,6 +3,7 @@ const path = require('path')
33const e2e = require ( '../support/helpers/e2e' )
44const Fixtures = require ( '../support/helpers/fixtures' )
55
6+ const e2eProject = Fixtures . projectPath ( 'e2e' )
67const pluginExtension = Fixtures . projectPath ( 'plugin-extension' )
78const pluginConfig = Fixtures . projectPath ( 'plugin-config' )
89const pluginFilterBrowsers = Fixtures . projectPath ( 'plugin-filter-browsers' )
@@ -14,10 +15,10 @@ const pluginReturnsBadConfig = Fixtures.projectPath('plugin-returns-bad-config')
1415const pluginReturnsEmptyBrowsersList = Fixtures . projectPath ( 'plugin-returns-empty-browsers-list' )
1516const pluginReturnsInvalidBrowser = Fixtures . projectPath ( 'plugin-returns-invalid-browser' )
1617
17- describe ( 'e2e plugins' , ( ) => {
18+ describe ( 'e2e plugins' , function ( ) {
1819 e2e . setup ( )
1920
20- it ( 'passes' , function ( ) {
21+ it ( 'passes with working preprocessor ' , function ( ) {
2122 return e2e . exec ( this , {
2223 spec : 'app_spec.coffee' ,
2324 project : workingPreprocessor ,
@@ -26,7 +27,7 @@ describe('e2e plugins', () => {
2627 } )
2728 } )
2829
29- it ( 'fails' , function ( ) {
30+ it ( 'fails with async error ' , function ( ) {
3031 return e2e . exec ( this , {
3132 spec : 'app_spec.coffee' ,
3233 project : pluginsAsyncError ,
@@ -121,4 +122,44 @@ describe('e2e plugins', () => {
121122 expectedExitCode : 1 ,
122123 } )
123124 } )
125+
126+ describe ( 'projectRoot and configFile' , function ( ) {
127+ it ( 'passes projectRoot and default configFile to plugins function' , function ( ) {
128+ return e2e . exec ( this , {
129+ spec : 'plugins_config_extras_spec.js' ,
130+ config : {
131+ env : {
132+ projectRoot : e2eProject ,
133+ configFile : path . join ( e2eProject , 'cypress.json' ) ,
134+ } ,
135+ } ,
136+ } )
137+ } )
138+
139+ it ( 'passes custom configFile to plugins function' , function ( ) {
140+ return e2e . exec ( this , {
141+ spec : 'plugins_config_extras_spec.js' ,
142+ configFile : 'cypress-alt.json' ,
143+ config : {
144+ env : {
145+ projectRoot : e2eProject ,
146+ configFile : path . join ( e2eProject , 'cypress-alt.json' ) ,
147+ } ,
148+ } ,
149+ } )
150+ } )
151+
152+ it ( 'passes false configFile to plugins function' , function ( ) {
153+ return e2e . exec ( this , {
154+ spec : 'plugins_config_extras_spec.js' ,
155+ configFile : 'false' ,
156+ config : {
157+ env : {
158+ projectRoot : e2eProject ,
159+ configFile : false ,
160+ } ,
161+ } ,
162+ } )
163+ } )
164+ } )
124165} )
0 commit comments