mirror of
https://github.com/nodejs/node.git
synced 2024-11-27 22:16:50 +01:00
b6e301a9e0
Add a known_issues test for the Windows returning ENOTFOUND where EINVAL is more appropriate. This happens with various functions in the `fs` module when an invalid path is used. Refs: https://github.com/nodejs/node/issues/8987 PR-URL: https://github.com/nodejs/node/pull/28569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
22 lines
585 B
JavaScript
22 lines
585 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
// Test that using an invalid file name with writeFileSync() on Windows returns
|
|
// EINVAL. With libuv 1.x, it returns ENOTFOUND. This should be fixed when we
|
|
// update to libuv 2.x.
|
|
//
|
|
// Refs: https://github.com/nodejs/node/issues/8987
|
|
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
|
|
if (!common.isWindows) {
|
|
// Change to `common.skip()` when the test is moved out of `known_issues`.
|
|
assert.fail('Windows-only test');
|
|
}
|
|
|
|
assert.throws(() => {
|
|
fs.writeFileSync('fhqwhgads??', 'come on');
|
|
}, { code: 'EINVAL' });
|