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
When the npm command is run in a cy.exec, npm not found is shown as the output. But on refreshing it the command is run without any errors. Error: CypressError: cy.exec('npm run removeDB')` failed because the command exited with a non-zero code.
Pass {failOnNonZeroExit: false} to ignore exit code failures.
Like in after the refresh the user should be able to get the npm run command on the first try rather than to refresh the runner.
Test code to reproduce
require("dotenv").config();consturl=process.env.DB_CONFIG;// create a client to mongodbconstMongoClient=require("mongodb").MongoClient;// make client connect to mongo serviceMongoClient.connect(url,function(err,db){if(err)throwerr;console.log("Connected to Database!");// delete the databasevardbo=db.db(`${process.env.PROJECT_KEY}`);// print database nameconsole.log("db object points to the database : "+dbo.databaseName);dbo.dropDatabase(function(err,result){console.log("Error : "+err);if(err)throwerr;console.log("Operation Success ? "+result);// after all the operations with db, close it.db.close();});});
Versions
Cypress package version: 6.5.0
Cypress binary version: 6.5.0
Electron version: 11.2.3
Bundled Node version: 12.18.3
CI not used
The text was updated successfully, but these errors were encountered:
Current behavior
When the npm command is run in a
cy.exec
, npm not found is shown as the output. But on refreshing it the command is run without any errors.Error: CypressError:
cy.exec('npm run removeDB')` failed because the command exited with a non-zero code.Pass
{failOnNonZeroExit: false}
to ignore exit code failures.Information about the failure:
Code: 127
Stderr:
zsh:1: command not found: npm
Because this error occurred during a
before all
hook we are skipping the remaining tests in the current suite:Test Cases - __AD...
at http://localhost:3000/__cypress/runner/cypress_runner.js:157481:26
From previous event:
at Context.exec (http://localhost:3000/__cypress/runner/cypress_runner.js:157454:105)
From Your Spec Code:
at Context.eval (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:290:6)`
Desired behavior
Like in after the refresh the user should be able to get the npm run command on the first try rather than to refresh the runner.
Test code to reproduce
Versions
Cypress package version: 6.5.0
Cypress binary version: 6.5.0
Electron version: 11.2.3
Bundled Node version: 12.18.3
CI not used
The text was updated successfully, but these errors were encountered: