Skip to content

Node crash if dimension mismatch in I.seeVisualDiff #41

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

Closed
tairun opened this issue Aug 14, 2019 · 6 comments · Fixed by #43
Closed

Node crash if dimension mismatch in I.seeVisualDiff #41

tairun opened this issue Aug 14, 2019 · 6 comments · Fixed by #43

Comments

@tairun
Copy link
Contributor

tairun commented Aug 14, 2019

  • codeceptjs-resemblehelper: 1.6.0
  • codeceptjs: 2.1.5
  • node: 10.14.0

When using release 1.6.0 of this helper, node crashes with the following error if the dimension of the screenshots is not the same:

error

This is most likely due to the version of resemblejs being used. In the package.json the version specified is: ^3.0.0 which installs 3.2.0. A simple fix would be to always use 3.0.0, which worked for me.

@Kartikeya99
Copy link
Contributor

That error is set by choice. Because if the dimensions aren't same then the tool behaves a bit unpredictably.

@tairun
Copy link
Contributor Author

tairun commented Aug 14, 2019

That error is set by choice. Because if the dimensions aren't same then the tool behaves a bit unpredictably.

I get that the diff-image produced by resemblejs with two images of different size isn't meaningful. But NODE crashes completely... which isn't a good thing. The error thrown should just cause the scenario to fail and then codeceptjs should get on with the next scenario. You still have the error in your tests about size mismatch in the end.

@tairun
Copy link
Contributor Author

tairun commented Aug 14, 2019

Instead of throwing error here, also reject(throw new Error(...)) with error... then it will also work with version 3.2.0 of resemblejs.

@Kartikeya99
Copy link
Contributor

Which node version are you using?

@tairun
Copy link
Contributor Author

tairun commented Aug 19, 2019

To quote myself here:

* codeceptjs-resemblehelper: 1.6.0

* codeceptjs: 2.1.5

* node: 10.14.0

@pablopaul
Copy link
Collaborator

I ran into the same today.

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

Successfully merging a pull request may close this issue.

3 participants