You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since fs is not allowed on Cypress/web browser, I am creating mocks for the fs functions being called in my source (non-test/Electron) code.
For example, fs.existsSync. This method is called many times and will return different responses. So instead of manually mocking and hard-coding all their responses, I just created a task inside the mock so it can be checked dynamically.
Uncaught Uncaught CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The command that returned the promise was:
> `cy.visit()`
The cy command you invoked inside the promise was:
> `cy.task()`
fs.existsSync() is being called during 'boot-up'.. So it is called during app creation (during cy.visit())
How can I use fs.existsSync??
Help!!!
The text was updated successfully, but these errors were encountered:
Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.
Since
fs
is not allowed on Cypress/web browser, I am creating mocks for thefs
functions being called in my source (non-test/Electron) code.For example,
fs.existsSync
. This method is called many times and will return different responses. So instead of manually mocking and hard-coding all their responses, I just created atask
inside the mock so it can be checked dynamically.And in my
plugins.js
, the task is simply implemented as:But then I am getting an error:
fs.existsSync()
is being called during 'boot-up'.. So it is called during app creation (duringcy.visit()
)How can I use
fs.existsSync
??Help!!!
The text was updated successfully, but these errors were encountered: