11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst tmpdir = require('../common/tmpdir');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst fs = require('fs');
61cb0ef41Sopenharmony_ciconst path = require('path');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_citmpdir.refresh();
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci{
111cb0ef41Sopenharmony_ci  assert.throws(
121cb0ef41Sopenharmony_ci    () =>
131cb0ef41Sopenharmony_ci      fs.rmdirSync(path.join(tmpdir.path, 'noexist.txt'), { recursive: true }),
141cb0ef41Sopenharmony_ci    {
151cb0ef41Sopenharmony_ci      code: 'ENOENT',
161cb0ef41Sopenharmony_ci    }
171cb0ef41Sopenharmony_ci  );
181cb0ef41Sopenharmony_ci}
191cb0ef41Sopenharmony_ci{
201cb0ef41Sopenharmony_ci  fs.rmdir(
211cb0ef41Sopenharmony_ci    path.join(tmpdir.path, 'noexist.txt'),
221cb0ef41Sopenharmony_ci    { recursive: true },
231cb0ef41Sopenharmony_ci    common.mustCall((err) => {
241cb0ef41Sopenharmony_ci      assert.strictEqual(err.code, 'ENOENT');
251cb0ef41Sopenharmony_ci    })
261cb0ef41Sopenharmony_ci  );
271cb0ef41Sopenharmony_ci}
281cb0ef41Sopenharmony_ci{
291cb0ef41Sopenharmony_ci  assert.rejects(
301cb0ef41Sopenharmony_ci    () => fs.promises.rmdir(path.join(tmpdir.path, 'noexist.txt'),
311cb0ef41Sopenharmony_ci                            { recursive: true }),
321cb0ef41Sopenharmony_ci    {
331cb0ef41Sopenharmony_ci      code: 'ENOENT',
341cb0ef41Sopenharmony_ci    }
351cb0ef41Sopenharmony_ci  ).then(common.mustCall());
361cb0ef41Sopenharmony_ci}
37