node/test/parallel/test-fs-constants.js
Liviu Ionescu c6547c5362
src: define fs.constants.S_IWUSR & S_IRUSR for Win
On Windows, most of the POSIX file mode definitions are not available.
However, functionally equivalent read/write definitions exists, and
chmod() can use them. This patch defines two aliases, so that these
definintions are issued in fs.constants.

fixes: https://github.com/nodejs/node/issues/41591

PR-URL: https://github.com/nodejs/node/pull/42757
Refs: https://github.com/nodejs/node/issues/41591
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-21 05:29:31 +01:00

9 lines
283 B
JavaScript

'use strict';
require('../common');
const fs = require('fs');
const assert = require('assert');
// Check if the two constants accepted by chmod() on Windows are defined.
assert.notStrictEqual(fs.constants.S_IRUSR, undefined);
assert.notStrictEqual(fs.constants.S_IWUSR, undefined);