mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02: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>
31 lines
600 B
JavaScript
31 lines
600 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const {
|
|
rmdir,
|
|
rmdirSync,
|
|
promises: { rmdir: rmdirPromise }
|
|
} = require('fs');
|
|
|
|
assert.throws(() => {
|
|
rmdir('nonexistent', {
|
|
recursive: true,
|
|
}, common.mustNotCall());
|
|
}, {
|
|
code: 'ERR_INVALID_ARG_VALUE',
|
|
});
|
|
|
|
assert.throws(() => {
|
|
rmdirSync('nonexistent', {
|
|
recursive: true,
|
|
});
|
|
}, {
|
|
code: 'ERR_INVALID_ARG_VALUE',
|
|
});
|
|
|
|
rmdirPromise('nonexistent', {
|
|
recursive: true,
|
|
}).then(common.mustNotCall(), common.mustCall((err) => {
|
|
assert.strictEqual(err.code, 'ERR_INVALID_ARG_VALUE');
|
|
}));
|