Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: avajs/ava
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a4cd3ea
Choose a base ref
...
head repository: avajs/ava
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d467e72
Choose a head ref
  • 4 commits
  • 10 files changed
  • 2 contributors

Commits on Feb 13, 2018

  1. Configuration menu
    Copy the full SHA
    0948d87 View commit details
    Browse the repository at this point in the history
  2. Place all throws/notThrows tests in test/assert.js

    Move tests from test/promise.js and test/observable.js.
    novemberborn committed Feb 13, 2018
    Configuration menu
    Copy the full SHA
    5da97cc View commit details
    Browse the repository at this point in the history
  3. Implement t.throws() and t.notThrows() ourselves

    Remove `core-assert` dependency. When passed a function as the second
    argument, `t.throws()` now assumes its a constructor. This removes
    support for a validation function, which may or may not have worked.
    Refs #1047.
    
    `t.throws()` now fails if the exception is not an error. Fixes #1440.
    
    Regular expressions are now matched against the error message, not the
    result of casting the error to a string. Fixes #1445.
    
    Validate second argument to `t.throws()`. Refs #1676.
    
    Assertion failures now display how AVA arrived at the exception.
    Constructors are printed when the error is not a correct instance.
    Fixes #1471.
    novemberborn committed Feb 13, 2018
    Configuration menu
    Copy the full SHA
    39e07ea View commit details
    Browse the repository at this point in the history
  4. Support expectation object in t.throws()

    Fixes #1047. Fixes #1676.
    
    A combination of the following expectations is supported:
    
    ```js
    t.throws(fn, {of: SyntaxError}) // err instanceof SyntaxError
    t.throws(fn, {name: 'SyntaxError'}) // err.name === 'SyntaxError'
    t.throws(fn, {is: expectedErrorInstance}) // err === expectedErrorInstance
    t.throws(fn, {message: 'expected error message'}) // err.message === 'expected error message'
    t.throws(fn, {message: /expected error message/}) // /expected error message/.test(err.message)
    ```
    novemberborn committed Feb 13, 2018
    Configuration menu
    Copy the full SHA
    d467e72 View commit details
    Browse the repository at this point in the history
Loading