mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
dcccbfdc79
The require('constants') module is currently undocumented and mashes together unrelated constants. This refactors the require('constants') in favor of distinct os.constants, fs.constants, and crypto.constants that are specific to the modules for which they are relevant. The next step is to document those within the specific modules. PR-URL: https://github.com/nodejs/node/pull/6534 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
16 lines
384 B
JavaScript
16 lines
384 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
// O_WRONLY without O_CREAT shall fail with ENOENT
|
|
const pathNE = path.join(common.tmpDir, 'file-should-not-exist');
|
|
assert.throws(
|
|
() => fs.openSync(pathNE, fs.constants.O_WRONLY),
|
|
(e) => e.code === 'ENOENT'
|
|
);
|