The Jest docs do not demonstrate a way of asserting that no exception was thrown, only that one was.
expect(() => ...error...).toThrow(error)
How do I assert if one was not thrown?
The Jest docs do not demonstrate a way of asserting that no exception was thrown, only that one was.
expect(() => ...error...).toThrow(error)
How do I assert if one was not thrown?
You can always use the
.not
method, which will be valid if your initial condition is false. It works for every jest test:https://facebook.github.io/jest/docs/en/expect.html#not