mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Has been runtime deprecated for ~ 5 years now. It's time. PR-URL: https://github.com/nodejs/node/pull/58616 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
34 lines
581 B
JavaScript
34 lines
581 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const tmpdir = require('../common/tmpdir');
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
|
|
tmpdir.refresh();
|
|
|
|
{
|
|
assert.throws(
|
|
() =>
|
|
fs.rmdirSync(tmpdir.resolve('noexist.txt')),
|
|
{
|
|
code: 'ENOENT',
|
|
}
|
|
);
|
|
}
|
|
{
|
|
fs.rmdir(
|
|
tmpdir.resolve('noexist.txt'),
|
|
common.mustCall((err) => {
|
|
assert.strictEqual(err.code, 'ENOENT');
|
|
})
|
|
);
|
|
}
|
|
{
|
|
assert.rejects(
|
|
() => fs.promises.rmdir(tmpdir.resolve('noexist.txt')),
|
|
{
|
|
code: 'ENOENT',
|
|
}
|
|
).then(common.mustCall());
|
|
}
|