Cypress - Plugins and Ecosystem
You want to create a custom plugin that reads a JSON file from disk and returns its content to your test. Which approach correctly implements this plugin task?
fs can be used to read files synchronously or asynchronously.cy.readFile is a test command, not available in plugins. Browser fetch is not available in Node.js plugin context. Using fs.readFileSync and returning parsed JSON is correct.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions