Cypress · Middle · Question 21 of 77
Where are cy.task handlers registered?
- 1In a global
tasks.jsonfile at the root - 2In the support file that runs in the browser
- 3In
setupNodeEventsin the Cypress config
Show the answer
Correct answer: In setupNodeEvents in the Cypress config
Explanation
on('task', { seedDb() { ... } }) runs in Node, where database clients and the file system are available.