1'use strict';
2const common = require('../common');
3const tmpdir = require('../common/tmpdir');
4const assert = require('assert');
5const fs = require('fs');
6const path = require('path');
7
8tmpdir.refresh();
9
10{
11  // Should warn when trying to delete a nonexistent path
12  common.expectWarning(
13    'DeprecationWarning',
14    'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
15      'will be removed. Use fs.rm(path, { recursive: true }) instead',
16    'DEP0147'
17  );
18  assert.throws(
19    () => fs.rmdirSync(path.join(tmpdir.path, 'noexist.txt'),
20                       { recursive: true }),
21    { code: 'ENOENT' }
22  );
23}
24