Closed LarsDenBakker closed 4 years ago
This will require passing around test line numbers. We need to check if mocha has this information in the browser.
that actually already works 🎉
it's a chai feature and always worked 😅
Failed tests look like this
demo/test/pass-1.test.js
test 2
AssertionError: expected 1 to be a string
at Context.<anonymous> (demo/test/pass-1.test.js:11:19)
you can click on demo/test/pass-1.test.js:11:19
and it will open the exact location which assertion failed 🤯
How could I have not known 😱 😱 😱 😱
ok we want to have it more obvious... something like this
demo/test/fail-object-diff.test.js
object diff
Go To Failed Assertion: demo/test/fail-object-diff.test.js:20:11
Open Test in Browser: http://localhost/...
expected { a: '1', b: '2', c: '3' } to equal { a: '1', b: '4', c: '3' }
+ expected - actual
{
"a": "1"
- "b": "2"
+ "b": "4"
"c": "3"
}
I implemented an initial version of this, we can track improving it in https://github.com/LarsDenBakker/web-test-runner/issues/25
Terminal links can have line numbers to jump directly to a failed test line number. We need to see if we think this is useful, or if it creates too much spam.