node/test/parallel/test-fs-write-no-fd.js
Myles Borins 8250bfd1e5
fs: Revert throw on invalid callbacks
This reverts 4cb5f3daa3

Based on community feedback I think we should consider reverting this
change. We should explore how this could be solved via linting rules.

Refs: https://github.com/nodejs/node/pull/12562
PR-URL: https://github.com/nodejs/node/pull/12976
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-05-20 10:21:34 -04:00

13 lines
262 B
JavaScript

'use strict';
require('../common');
const fs = require('fs');
const assert = require('assert');
assert.throws(function() {
fs.write(null, Buffer.allocUnsafe(1), 0, 1);
}, /TypeError/);
assert.throws(function() {
fs.write(null, '1', 0, 1);
}, /TypeError/);