11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// Test that using an invalid file name with writeFileSync() on Windows returns
61cb0ef41Sopenharmony_ci// EINVAL. With libuv 1.x, it returns ENOTFOUND. This should be fixed when we
71cb0ef41Sopenharmony_ci// update to libuv 2.x.
81cb0ef41Sopenharmony_ci//
91cb0ef41Sopenharmony_ci// Refs: https://github.com/nodejs/node/issues/8987
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ciconst assert = require('assert');
121cb0ef41Sopenharmony_ciconst fs = require('fs');
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciif (!common.isWindows) {
151cb0ef41Sopenharmony_ci  // Change to `common.skip()` when the test is moved out of `known_issues`.
161cb0ef41Sopenharmony_ci  assert.fail('Windows-only test');
171cb0ef41Sopenharmony_ci}
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ciassert.throws(() => {
201cb0ef41Sopenharmony_ci  fs.writeFileSync('fhqwhgads??', 'come on');
211cb0ef41Sopenharmony_ci}, { code: 'EINVAL' });
22