xref: /third_party/node/test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
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  // Should warn when trying to delete a nonexistent path
121cb0ef41Sopenharmony_ci  common.expectWarning(
131cb0ef41Sopenharmony_ci    'DeprecationWarning',
141cb0ef41Sopenharmony_ci    'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
151cb0ef41Sopenharmony_ci      'will be removed. Use fs.rm(path, { recursive: true }) instead',
161cb0ef41Sopenharmony_ci    'DEP0147'
171cb0ef41Sopenharmony_ci  );
181cb0ef41Sopenharmony_ci  assert.throws(
191cb0ef41Sopenharmony_ci    () => fs.rmdirSync(path.join(tmpdir.path, 'noexist.txt'),
201cb0ef41Sopenharmony_ci                       { recursive: true }),
211cb0ef41Sopenharmony_ci    { code: 'ENOENT' }
221cb0ef41Sopenharmony_ci  );
231cb0ef41Sopenharmony_ci}
24

Indexes created Thu Nov 07 10:32:03 CST 2024