[tests] Async test framework
- No need for multiple assertAsyncRan() calls, just do t.plan(count) - Previously, if you forget to call assertAsyncRan(), the test will still pass, which is no longer true. - No longer hold global state (with asyncAssertsExpected). Previously if one assert wasn't hit then there's no way to find out which test failed. You'd have to comment each test and try again. - Each test runs independently in the microtask queue. - Better failure reporting by printing the entire function. Example error : === mjsunit/harmony/promise-prototype-finally === abort: Expected asserts: 2, Actual asserts: 1 in test: reject/finally/then assert => { assert.plan(2); Promise.reject(3).finally().then( assert.unreachable, x => { assert.equals(3, x); }); } Change-Id: Ic3f6272e1e87b8b0121b8c8c7cce19cf90d1f1be Reviewed-on: https://chromium-review.googlesource.com/455555 Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Daniel Ehrenberg <littledan@chromium.org> Reviewed-by: Caitlin Potter <caitp@igalia.com> Cr-Commit-Position: refs/heads/master@{#46910}
Showing
Please
register
or
sign in
to comment