deno.land / std@0.166.0 / node / _tools / test / parallel / test-fs-rmdir-recursive-throws-not-found.js
1234567891011121314151617181920212223242526272829303132333435363738394041424344// deno-fmt-ignore-file// deno-lint-ignore-file
// Copyright Joyent and Node contributors. All rights reserved. MIT license.// Taken from Node 18.12.0// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
'use strict';const common = require('../common');const tmpdir = require('../common/tmpdir');const assert = require('assert');const fs = require('fs');const path = require('path');
tmpdir.refresh();
{ assert.throws( () => fs.rmdirSync(path.join(tmpdir.path, 'noexist.txt'), { recursive: true }), { code: 'ENOENT', } );}{ fs.rmdir( path.join(tmpdir.path, 'noexist.txt'), { recursive: true }, common.mustCall((err) => { assert.strictEqual(err.code, 'ENOENT'); }) );}{ assert.rejects( () => fs.promises.rmdir(path.join(tmpdir.path, 'noexist.txt'), { recursive: true }), { code: 'ENOENT', } ).then(common.mustCall());}
Version Info