diff --git a/tests/fs/dir.test.ts b/tests/fs/dir.test.ts index 49160f32..5f1aac2d 100644 --- a/tests/fs/dir.test.ts +++ b/tests/fs/dir.test.ts @@ -93,13 +93,13 @@ suite('Dir', () => { test('close()', async () => { const dir = fs.opendirSync(testDirPath); await dir.close(); - rejects(dir.read(), 'Can not use closed Dir'); + rejects(dir.read()); }); test('closeSync()', () => { const dir = fs.opendirSync(testDirPath); dir.closeSync(); - assert.throws(() => dir.readSync(), 'Can not use closed Dir'); + assert.throws(() => dir.readSync()); }); test('asynchronous iteration', async () => { @@ -119,13 +119,13 @@ suite('Dir', () => { test('read after directory is closed', async () => { const dir = fs.opendirSync(testDirPath); await dir.close(); - await assert.rejects(dir.read(), 'Can not use closed Dir'); + await assert.rejects(dir.read()); }); test('readSync after directory is closed', () => { const dir = fs.opendirSync(testDirPath); dir.closeSync(); - assert.throws(() => dir.readSync(), 'Can not use closed Dir'); + assert.throws(() => dir.readSync()); }); test('close multiple times', async () => { diff --git a/tests/fs/errors.test.ts b/tests/fs/errors.test.ts index d86b91dd..596a4890 100644 --- a/tests/fs/errors.test.ts +++ b/tests/fs/errors.test.ts @@ -9,7 +9,6 @@ suite('Error messages', () => { const path = '/non-existent'; fs.promises.stat(path).catch((error: ErrnoError) => { - assert.equal(error.toString(), error.message); assert.equal(error.bufferSize(), 4 + JSON.stringify(error.toJSON()).length); });