1'use strict'; 2 3const common = require('../common'); 4 5// Test that using an invalid file name with writeFileSync() on Windows returns 6// EINVAL. With libuv 1.x, it returns ENOTFOUND. This should be fixed when we 7// update to libuv 2.x. 8// 9// Refs: https://github.com/nodejs/node/issues/8987 10 11const assert = require('assert'); 12const fs = require('fs'); 13 14if (!common.isWindows) { 15 // Change to `common.skip()` when the test is moved out of `known_issues`. 16 assert.fail('Windows-only test'); 17} 18 19assert.throws(() => { 20 fs.writeFileSync('fhqwhgads??', 'come on'); 21}, { code: 'EINVAL' }); 22