• Sathya Gunasekaran's avatar
    [tests] Async test framework · 61ed6a00
    Sathya Gunasekaran authored
    - 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: 's avatarAdam Klein <adamk@chromium.org>
    Reviewed-by: 's avatarDaniel Ehrenberg <littledan@chromium.org>
    Reviewed-by: 's avatarCaitlin Potter <caitp@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#46910}
    61ed6a00
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...