PR-URL: https://github.com/nodejs/node/pull/17667 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
24 lines
503 B
JavaScript
24 lines
503 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
|
|
['', false, null, undefined, {}, []].forEach((i) => {
|
|
common.expectsError(
|
|
() => fs.close(i),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "fd" argument must be of type integer'
|
|
}
|
|
);
|
|
common.expectsError(
|
|
() => fs.closeSync(i),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "fd" argument must be of type integer'
|
|
}
|
|
);
|
|
});
|