diff --git a/doc/api/assert.md b/doc/api/assert.md index 11ee21c0ea2d11..7c9f8684d068ba 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -2137,7 +2137,7 @@ assert.throws( ); // Using regular expressions to validate error properties: -throws( +assert.throws( () => { throw err; }, @@ -2161,7 +2161,7 @@ throws( ); // Fails due to the different `message` and `name` properties: -throws( +assert.throws( () => { const otherErr = new Error('Not found'); // Copy all enumerable properties from `err` to `otherErr`. @@ -2206,7 +2206,7 @@ assert.throws( ); // Using regular expressions to validate error properties: -throws( +assert.throws( () => { throw err; }, @@ -2230,7 +2230,7 @@ throws( ); // Fails due to the different `message` and `name` properties: -throws( +assert.throws( () => { const otherErr = new Error('Not found'); // Copy all enumerable properties from `err` to `otherErr`.