File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,16 @@ const registerHooks = () => {
220
220
// to disable code coverage commands and save time
221
221
// pass environment variable coverage=false
222
222
// cypress run --env coverage=false
223
+ // or
224
+ // CYPRESS_coverage=false cypress run
223
225
// see https://on.cypress.io/environment-variables
224
- if ( Cypress . env ( 'coverage' ) === false ) {
226
+
227
+ // to avoid "coverage" env variable being case-sensitive, convert to lowercase
228
+ const cyEnvs = Cypress . _ . mapKeys ( Cypress . env ( ) , ( value , key ) =>
229
+ key . toLowerCase ( )
230
+ )
231
+
232
+ if ( cyEnvs . coverage === false ) {
225
233
console . log ( 'Skipping code coverage hooks' )
226
234
} else if ( Cypress . env ( 'codeCoverageTasksRegistered' ) !== true ) {
227
235
// register a hook just to log a message
You can’t perform that action at this time.
0 commit comments