Skip to content

Commit 27f2bc8

Browse files
Set default return to false in getRequestIntercepted
1 parent 99a3fb8 commit 27f2bc8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cypress/support/commands/api_commands.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ const setRequestIntercepted = (value) =>
7171
/**
7272
* Gets the current value of the request interception flag from Cypress environment.
7373
* This flag indicates whether a request matching an intercept pattern was detected.
74-
* @returns {boolean} The current value of the request interception flag
74+
* @returns {boolean} The current value of the request interception flag, by default returns false
7575
*/
76-
const getRequestIntercepted = () => Cypress.env('wasRequestIntercepted');
76+
const getRequestIntercepted = () =>
77+
Cypress.env('wasRequestIntercepted') || false;
7778

7879
/**
7980
* Custom command to intercept API calls and wait for them to complete.

0 commit comments

Comments
 (0)