diff --git a/docs/UsingMatchers.md b/docs/UsingMatchers.md index e34cff57f7af..dc7dd4971959 100644 --- a/docs/UsingMatchers.md +++ b/docs/UsingMatchers.md @@ -155,6 +155,8 @@ test('compiling android goes as expected', () => { }); ``` +> Note: the function that throws an exception needs to be invoked within a wrapping function otherwise the `toThrow` assertion will fail. + ## And More This is just a taste. For a complete list of matchers, check out the [reference docs](ExpectAPI.md). diff --git a/website/versioned_docs/version-22.x/UsingMatchers.md b/website/versioned_docs/version-22.x/UsingMatchers.md index 435a1447eea7..26114d7863b9 100644 --- a/website/versioned_docs/version-22.x/UsingMatchers.md +++ b/website/versioned_docs/version-22.x/UsingMatchers.md @@ -156,6 +156,8 @@ test('compiling android goes as expected', () => { }); ``` +> Note: the function that throws an exception needs to be invoked within a wrapping function otherwise the `toThrow` assertion will fail. + ## And More This is just a taste. For a complete list of matchers, check out the [reference docs](ExpectAPI.md).