morficus / cypress-dotenv

Cypress plugin that enables compatability with dotenv
53 stars 13 forks source link

Fails if `.env` file does not exist #3

Closed vvanpo closed 4 years ago

vvanpo commented 4 years ago
yarn run v1.22.0
$ cypress run
The function exported by the plugins file threw an error.

We invoked the function exported by `.../test/cypress/plugins/index.js`, but it threw an error.

 TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at exports.default (.../node_modules/dotenv-parse-variables/lib/index.js:25:10)
    at module.exports (.../node_modules/cypress-dotenv/index.js:15:13)
    at module.exports (.../test/cypress/plugins/index.js:20:35)
    at /Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:77:12
    at tryCatcher (/Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
    at load (/Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:76:7)
    at EventEmitter.<anonymous> (/Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:197:5)
    at EventEmitter.emit (events.js:203:13)
    at process.<anonymous> (/Users/victor/Library/Caches/Cypress/4.0.2/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:25:29)
    at process.emit (events.js:203:13)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vvanpo commented 4 years ago

I see now that #2 is open that will fix this, so I can close this.