Current behavior
With the latest Cypress version 12.15.0 cy.task() is broken. It says "cy.task() must only be invoked from the spec file or support file."


Desired behavior
It should work as in previous Cypress version
Test code to reproduce
cypress.config.js
const { defineConfig } = require('cypress')
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
on('task', {
log(message) {
console.log(message)
return null
},
})
},
},
})
spec.cy.js
describe("Test for bug ", () => {
it(`should be working`, () => {
cy.task('log', 'This will be output to the terminal')
})
});
Cypress Version
12.15.0
Node version
16.15
Operating System
win10
Debug Logs
No response
Other
No response
Current behavior
With the latest Cypress version 12.15.0 cy.task() is broken. It says "cy.task() must only be invoked from the spec file or support file."
Desired behavior
It should work as in previous Cypress version
Test code to reproduce
cypress.config.jsspec.cy.jsCypress Version
12.15.0
Node version
16.15
Operating System
win10
Debug Logs
No response
Other
No response