Open mmkal opened 2 years ago
Describe the bug
const x = await evaluate(() => { return document.querySelector('.doesNotExist').textContent })
When no element with class doesNotExist exists x will have value {}. I think this is because it's a json-ified error.
doesNotExist
x
{}
To Reproduce
const { openBrowser, evaluate, goto } = require('taiko'); openBrowser(); goto('https://example.com') const x = await evaluate(() => { return document.querySelector('.doesNotExist').textContent }) console.log(x);
Expected behavior
evaluate should throw when the client function throws. It might require wrapping the function and returning an either type which includes the message and the stack of the error.
evaluate
Describe the bug
When no element with class
doesNotExist
existsx
will have value{}
. I think this is because it's a json-ified error.To Reproduce
Expected behavior
evaluate
should throw when the client function throws. It might require wrapping the function and returning an either type which includes the message and the stack of the error.