lazy-ass
lazy-ass copied to clipboard
Custom assessment output
Hi Gleb,
We totally love this utility, and we've come up to use for our protractor tests runner (nodejs environment). The issue is that in the newest Protractor, throwing an error will stop the testing. We want to continue, and we'll get all the reporting after. Is it possible to configure lazyAss to call a function, instead of
throw err;
→ output(err)
The default should be kept as is (throwing errors), and in some cases we want to do console.log or any other output stream we'll come up with.
Thanks!
Is there no flag for Protractor to continue even if a test fails or an error is thrown?
I guess no, it's actually in Jasmine. What we really want to fix is to get the detailed 'expect' message, this issue is still not fixed https://github.com/jasmine/jasmine/issues/641. Our workaround is like this: first expect, then check with lazy-ass
the same condition.
expect(text.indexOf(expectedText)).toBeGreaterThan(-1);
la(index > -1, 'expected', text, 'to contain', expectedText);
Would be nice if lazy-ass could output it's parsing, then we can create a PR to jasmine using it.