Skip to content

Commit ab55cee

Browse files
Apply suggestions from code review
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 8e64d58 commit ab55cee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/rules/prefer-t-throws.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const test = require('ava');
99

1010
test('some test', async t => {
1111
try {
12-
await Promise.reject('error');
12+
await potentiallyThrowingFunction();
1313
t.fail();
1414
} catch (error) {
15-
t.is(error, 'error');
15+
t.is(error.message, 'Unicorn overload');
1616
}
1717
});
1818
```
@@ -57,4 +57,3 @@ test('some test', async t => {
5757
}
5858
});
5959
```
60-

0 commit comments

Comments
 (0)