Skip to content

Commit 580b86c

Browse files
committed
Fix incorrect usage of assert.rejects argument
Updated error test to reflect bug fix
1 parent 227e248 commit 580b86c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/fs/dir.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ suite('Dir', () => {
9393
test('close()', async () => {
9494
const dir = fs.opendirSync(testDirPath);
9595
await dir.close();
96-
rejects(dir.read(), 'Can not use closed Dir');
96+
rejects(dir.read());
9797
});
9898

9999
test('closeSync()', () => {
100100
const dir = fs.opendirSync(testDirPath);
101101
dir.closeSync();
102-
assert.throws(() => dir.readSync(), 'Can not use closed Dir');
102+
assert.throws(() => dir.readSync());
103103
});
104104

105105
test('asynchronous iteration', async () => {
@@ -119,13 +119,13 @@ suite('Dir', () => {
119119
test('read after directory is closed', async () => {
120120
const dir = fs.opendirSync(testDirPath);
121121
await dir.close();
122-
await assert.rejects(dir.read(), 'Can not use closed Dir');
122+
await assert.rejects(dir.read());
123123
});
124124

125125
test('readSync after directory is closed', () => {
126126
const dir = fs.opendirSync(testDirPath);
127127
dir.closeSync();
128-
assert.throws(() => dir.readSync(), 'Can not use closed Dir');
128+
assert.throws(() => dir.readSync());
129129
});
130130

131131
test('close multiple times', async () => {

tests/fs/errors.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ suite('Error messages', () => {
99
const path = '/non-existent';
1010

1111
fs.promises.stat(path).catch((error: ErrnoError) => {
12-
assert.equal(error.toString(), error.message);
1312
assert.equal(error.bufferSize(), 4 + JSON.stringify(error.toJSON()).length);
1413
});
1514

0 commit comments

Comments
 (0)