blob: 1fe0294f68b714d19a5f22499e169ebb4d27b2d8 [file] [edit]
'use strict';
require('../common');
const assert = require('assert');
const fs = require('fs');
[Infinity, -Infinity, NaN].forEach((input) => {
assert.throws(
() => {
fs._toUnixTimestamp(input);
},
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError'
});
});
assert.throws(
() => {
fs._toUnixTimestamp({});
},
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError'
});
const okInputs = [1, -1, '1', '-1', Date.now()];
okInputs.forEach((input) => {
fs._toUnixTimestamp(input);
});