JSPM

  • Created
  • Published
  • Downloads 805
  • Score
    100M100P100Q89655F
  • License GPL-3.0-or-later

Method to expect that an async function throws

Package Exports

  • expect-to-throw
  • expect-to-throw/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expect-to-throw) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

expect-to-throw

Just a method to expect an async method to throw

const expectToThrow = require('expect-to-throw')

describe('some method', function(){
    it('must throw', async function(){
        await expectToThrow(async function(){
            await someMethod()
        })
    })
})