How to use the assertive.rejects function in assertive

To help you get started, we’ve selected a few assertive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jarrodldavis / probot-gpg / test / plugin.js View on Github external
it('should throw if `acceptEvent` is called with incorrect execution context', async () => {
    // Arrange
    const { plugin, robotMock, contextMock } = arrange(sinon.stub())

    plugin.on('error', sinon.stub())

    plugin.load(robotMock)

    // Act, Assert
    const err = await assert.rejects(plugin.acceptEvent.call(undefined, contextMock))
    assert.equal('Unexpected execution context for method call', err.message)
  })
})

assertive

Assertive is a terse yet expressive assertion library

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

49 / 100
Full package analysis