summaryrefslogtreecommitdiff
path: root/test/known_issues/test-fs-writeFileSync-invalid-windows.js
blob: 614b7427c02d98e7d1901def234f01922a8b9655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'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' });