diff --git a/website/versioned_docs/version-23.6/ExpectAPI.md b/website/versioned_docs/version-23.6/ExpectAPI.md index ccc07eb10d19..046fcf21cb70 100644 --- a/website/versioned_docs/version-23.6/ExpectAPI.md +++ b/website/versioned_docs/version-23.6/ExpectAPI.md @@ -501,7 +501,7 @@ For example, this code tests that the promise rejects with reason `'octopus'`: ```js test('rejects to octopus', () => { // make sure to add a return statement - return expect(Promise.reject(new Error('octopus'))).rejects.toThrow( + return expect(Promise.reject(new Error('octopus'))).rejects.toEqual( 'octopus', ); }); @@ -513,7 +513,7 @@ Alternatively, you can use `async/await` in combination with `.rejects`. ```js test('rejects to octopus', async () => { - await expect(Promise.reject(new Error('octopus'))).rejects.toThrow('octopus'); + await expect(Promise.reject(new Error('octopus'))).rejects.toEqual('octopus'); }); ```