node/test/parallel/test-fs-watch-recursive-validate.js
Yagiz Nizipli 8398f852d5
test: split parallel fs-watch-recursive tests
PR-URL: https://github.com/nodejs/node/pull/45865
Fixes: https://github.com/nodejs/node/issues/45535
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-12-20 14:25:48 +00:00

35 lines
894 B
JavaScript

'use strict';
const common = require('../common');
if (common.isIBMi)
common.skip('IBMi does not support `fs.watch()`');
// fs-watch on folders have limited capability in AIX.
// The testcase makes use of folder watching, and causes
// hang. This behavior is documented. Skip this for AIX.
if (common.isAIX)
common.skip('folder watch capability is limited in AIX.');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const tmpdir = require('../common/tmpdir');
const testDir = tmpdir.path;
tmpdir.refresh();
(async () => {
// Handle non-boolean values for options.recursive
if (!common.isWindows && !common.isOSX) {
assert.throws(() => {
const testsubdir = fs.mkdtempSync(testDir + path.sep);
fs.watch(testsubdir, { recursive: '1' });
}, {
code: 'ERR_INVALID_ARG_TYPE',
});
}
})().then(common.mustCall());