From d554eb1ae9ae7118e2691e1fa43b8e9fc7c37e7d Mon Sep 17 00:00:00 2001 From: Gopal Venkatesan Date: Fri, 30 Oct 2020 23:43:29 +0530 Subject: [PATCH] Add a note to the Exceptions section (#10742) --- docs/UsingMatchers.md | 2 ++ website/versioned_docs/version-22.x/UsingMatchers.md | 2 ++ 2 files changed, 4 insertions(+) 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).