From 5a4517162326df7c045ee9ac1530e13434d07b17 Mon Sep 17 00:00:00 2001 From: Rahul Roy Date: Fri, 13 Sep 2019 13:22:25 +0530 Subject: [PATCH] Fix example code on `using matchers` docs (#8953) * Fix example code on `using matchers` docs * Change UsingMatchers docs for version-22.x as well --- docs/UsingMatchers.md | 4 ++-- website/versioned_docs/version-22.x/UsingMatchers.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/UsingMatchers.md b/docs/UsingMatchers.md index d6fab01b4dc9..ef52762c91fa 100644 --- a/docs/UsingMatchers.md +++ b/docs/UsingMatchers.md @@ -142,12 +142,12 @@ If you want to test that a particular function throws an error when it's called, ```js function compileAndroidCode() { - throw new ConfigError('you are using the wrong JDK'); + throw new Error('you are using the wrong JDK'); } test('compiling android goes as expected', () => { expect(compileAndroidCode).toThrow(); - expect(compileAndroidCode).toThrow(ConfigError); + expect(compileAndroidCode).toThrow(Error); // You can also use the exact error message or a regexp expect(compileAndroidCode).toThrow('you are using the wrong JDK'); diff --git a/website/versioned_docs/version-22.x/UsingMatchers.md b/website/versioned_docs/version-22.x/UsingMatchers.md index 001537780915..2a6b40c532fb 100644 --- a/website/versioned_docs/version-22.x/UsingMatchers.md +++ b/website/versioned_docs/version-22.x/UsingMatchers.md @@ -143,12 +143,12 @@ If you want to test that a particular function throws an error when it's called, ```js function compileAndroidCode() { - throw new ConfigError('you are using the wrong JDK'); + throw new Error('you are using the wrong JDK'); } test('compiling android goes as expected', () => { expect(compileAndroidCode).toThrow(); - expect(compileAndroidCode).toThrow(ConfigError); + expect(compileAndroidCode).toThrow(Error); // You can also use the exact error message or a regexp expect(compileAndroidCode).toThrow('you are using the wrong JDK');