webdriverio-boneyard / wdio-sync

A WebdriverIO v4 plugin. Helper module to run WebdriverIO commands synchronously.
http://v4.webdriver.io
MIT License
17 stars 31 forks source link

Fix sanitizeErrorMessage corner case #42

Closed pscanf closed 7 years ago

pscanf commented 7 years ago

(I believe this might be the cause of webdriverio/webdriverio#1726)

Scenario:

(I can reproduce this in a client project I'm working on that I can't share, let me know if an "open reproduction" is needed)

The error is a bit erratic. On my local machine (macOS), with the exact same run, sometimes it happens, sometimes it doesn't, meaning sometimes the stack trace has 2 lines, sometimes 3. In a docker container (ubuntu) it appears to be systematic. I did not succeed to pinpoint the reason behind that.

This pull request attempts to fix the error described above by adding an undefined-check on lineToFix. Now when lineToFix === undefined the else case will be executed. I'm not sure if that is the correct/desired fallback though.

christian-bromann commented 7 years ago

Undefined checks are always appreciated 👍

pscanf commented 7 years ago

Thanks. :)

monolithed commented 7 years ago

@pscanf, more thanks for that! @christian-bromann, could you make a release, please?