Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] Error from fse.copy is not handled correctly #81

Open
earshinov opened this issue Nov 23, 2018 · 2 comments
Open

[minor] Error from fse.copy is not handled correctly #81

earshinov opened this issue Nov 23, 2018 · 2 comments

Comments

@earshinov
Copy link

earshinov commented Nov 23, 2018

Got these warnings when trying to use the plugin for the first time:

[chrome #01-4] (node:28932) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, chmod 'C:\dev\e2e\results\styles'
[chrome #01-4] (node:28932) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[chrome #01-4] (node:28932) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

As far as I can see, the primary suspect is fse.copy call at

fse.copy(src, dest);
that needs to either be changed to fse.copySync or be given a callback to capture the error.

@earshinov
Copy link
Author

There is a similar issue with mkdirp.sync, for example at

mkdirp.sync(this.config.screenshotPath + '/screenshots', function(err) {

You should either use mkdirp instead of mkdirp.sync or transform the callback into a try..catch clause.

@azachar
Copy link
Owner

azachar commented Nov 24, 2018

Hi there!

Feel free to provide a PR that will fix it. I am developing against mac and tests are run against a linux machine, so there might some specific issues with windows platform...

Cheers,
Andrej

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants