Bird
0
0

Find the mistake in this assertion:

medium📝 Debug Q7 of 15
Cypress - Assertions
Find the mistake in this assertion:
expect(response.status).to.equal 200;
AMissing parentheses after equal
Bresponse.status is not a valid property
Cequal should be replaced with equals
DMissing semicolon causes error
Step-by-Step Solution
Solution:
  1. Step 1: Check the syntax of the equal assertion

    The method equal requires parentheses: equal(200).
  2. Step 2: Verify other parts

    response.status is a common property, and semicolon is optional in JS.
  3. Final Answer:

    Missing parentheses after equal -> Option A
  4. Quick Check:

    Method calls need () even in assertions [OK]
Quick Trick: Always use () after assertion methods like equal() [OK]
Common Mistakes:
  • Omitting () after equal
  • Using equals instead of equal
  • Assuming property is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes