Skip to content

Commit

Permalink
use t.throwsAsync instead
Browse files Browse the repository at this point in the history
...not worth the effort
  • Loading branch information
jimmywarting committed May 28, 2021
1 parent 5dc229f commit b5fa0bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ test('Reading after modified should fail', async t => {
const now = new Date();
// Change modified time
fs.utimesSync('./LICENSE', now, now);
const error = await blob.text().catch(error => error);
const error = await t.throwsAsync(blob.text());
t.is(error.constructor.name, 'DOMException');
t.is(error instanceof Error, true);
t.is(error.name, 'NotReadableError');
Expand All @@ -179,7 +179,7 @@ test('Reading file after modified should fail', async t => {
const now = new Date();
// Change modified time
fs.utimesSync('./LICENSE', now, now);
const error = await file.text().catch(error => error);
const error = await t.throwsAsync(file.text());
t.is(error.constructor.name, 'DOMException');
t.is(error instanceof Error, true);
t.is(error.name, 'NotReadableError');
Expand Down

0 comments on commit b5fa0bd

Please sign in to comment.