File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ async function install(arg) {
126126 }
127127}
128128
129+ async function verify ( arg ) {
130+ debug ( 'verifying Cypress can run' )
131+ try {
132+ await arg . utils . run ( 'cypress' , [ 'verify' ] )
133+ } catch ( error ) {
134+ debug ( 'error verifying Cypress: %s' , error . message )
135+ const buildUtils = arg . utils . build
136+ console . error ( '' )
137+ console . error ( 'Failed to verify Cypress' )
138+ console . error ( '' )
139+ buildUtils . failBuild ( 'Failed to verify Cypress' , { error } )
140+ }
141+ }
142+
129143const processCypressResults = ( results , buildUtils ) => {
130144 if ( results . failures ) {
131145 // Cypress failed without even running the tests
@@ -185,6 +199,7 @@ const hasRecordKey = () => typeof process.env.CYPRESS_RECORD_KEY === 'string'
185199module . exports = {
186200 onPreBuild : async ( arg ) => {
187201 await install ( arg )
202+ await verify ( arg )
188203
189204 debug ( 'cypress plugin preBuild inputs %o' , arg . inputs )
190205 const preBuildInputs = arg . inputs && arg . inputs . preBuild
You can’t perform that action at this time.
0 commit comments