Skip to content

Commit b5fa0bd

Browse files
committed
use t.throwsAsync instead
...not worth the effort
1 parent 5dc229f commit b5fa0bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ test('Reading after modified should fail', async t => {
165165
const now = new Date();
166166
// Change modified time
167167
fs.utimesSync('./LICENSE', now, now);
168-
const error = await blob.text().catch(error => error);
168+
const error = await t.throwsAsync(blob.text());
169169
t.is(error.constructor.name, 'DOMException');
170170
t.is(error instanceof Error, true);
171171
t.is(error.name, 'NotReadableError');
@@ -179,7 +179,7 @@ test('Reading file after modified should fail', async t => {
179179
const now = new Date();
180180
// Change modified time
181181
fs.utimesSync('./LICENSE', now, now);
182-
const error = await file.text().catch(error => error);
182+
const error = await t.throwsAsync(file.text());
183183
t.is(error.constructor.name, 'DOMException');
184184
t.is(error instanceof Error, true);
185185
t.is(error.name, 'NotReadableError');

0 commit comments

Comments
 (0)