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');