Bird
0
0

You have this Cypress test code:

medium📝 Debug Q14 of 15
Cypress - Writing Tests
You have this Cypress test code:
describe.skip('Group X', () => {
  it.only('Test A', () => { /* code */ })
  it('Test B', () => { /* code */ })
})
describe('Group Y', () => {
  it('Test C', () => { /* code */ })
})
What is the problem with this code?
ATest C will run but Group X tests will be skipped.
BTest A will run but Test B and Test C will be skipped.
CTest A will run but Group Y tests will be skipped.
DNo tests will run because the entire Group X is skipped.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze describe.skip effect on Group X

    The entire Group X is skipped, so none of its tests run, including it.only.
  2. Step 2: Analyze Group Y tests

    Group Y is not skipped, so its test (Test C) runs normally.
  3. Final Answer:

    Test C will run but Group X tests will be skipped. -> Option A
  4. Quick Check:

    describe.skip skips whole group, ignoring it.only [OK]
Quick Trick: describe.skip disables all tests inside, even it.only [OK]
Common Mistakes:
  • Assuming it.only overrides describe.skip
  • Thinking some tests in skipped group run
  • Confusing which group is skipped

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes