Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8.x] backport assert: add rejects() and doesNotReject() #24019

Closed

Commits on Nov 1, 2018

  1. assert: add rejects() and doesNotReject()

    Implement asynchronous equivalent for assert.throws() and
    assert.doesNotThrow().
    
    PR-URL: nodejs#18023
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    feugy authored and MylesBorins committed Nov 1, 2018
    Configuration menu
    Copy the full SHA
    4ee80bc View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2018

  1. test: ensure failed assertions cause build to fail

    This updates the test in `test/parallel/test-assert-async.js` to add an
    assertion that the Promises used in the test end up fulfilled.
    Previously, if an assertion failure occurred, the Promises would have
    rejected and a warning would have been logged, but the test would still
    have exit code 0.
    
    PR-URL: nodejs#19650
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    not-an-aardvark authored and MylesBorins committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    30bfd25 View commit details
    Browse the repository at this point in the history
  2. assert: ensure .rejects() disallows sync throws

    This updates `assert.rejects()` to disallow any errors that are thrown
    synchronously from the given function. Previously, throwing an error
    would cause the same behavior as returning a rejected Promise.
    
    Fixes: nodejs#19646
    PR-URL: nodejs#19650
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    not-an-aardvark authored and MylesBorins committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    c247052 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2018

  1. Configuration menu
    Copy the full SHA
    38ef81d View commit details
    Browse the repository at this point in the history