xref: /third_party/node/test/parallel/test-fs-rmdir-recursive-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 fs = require('fs');
51cb0ef41Sopenharmony_ciconst path = require('path');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_citmpdir.refresh();
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci{
101cb0ef41Sopenharmony_ci  // Should warn when trying to delete a nonexistent path
111cb0ef41Sopenharmony_ci  common.expectWarning(
121cb0ef41Sopenharmony_ci    'DeprecationWarning',
131cb0ef41Sopenharmony_ci    'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
141cb0ef41Sopenharmony_ci      'will be removed. Use fs.rm(path, { recursive: true }) instead',
151cb0ef41Sopenharmony_ci    'DEP0147'
161cb0ef41Sopenharmony_ci  );
171cb0ef41Sopenharmony_ci  fs.rmdir(
181cb0ef41Sopenharmony_ci    path.join(tmpdir.path, 'noexist.txt'),
191cb0ef41Sopenharmony_ci    { recursive: true },
201cb0ef41Sopenharmony_ci    common.mustCall()
211cb0ef41Sopenharmony_ci  );
221cb0ef41Sopenharmony_ci}
23

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