Skip to content

unsegnor/expect-to-throw

Repository files navigation

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()
        })
    })
})

About

expectToThrow('error message', async function(){ await fn() })

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •