You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
575 B

'use strict';
const common = require('../common');
const fs = require('fs');
const assert = require('assert');
[Infinity, -Infinity, NaN].forEach((input) => {
common.expectsError(
() => {
fs._toUnixTimestamp(input);
},
{
code: 'ERR_INVALID_ARG_TYPE',
type: Error
});
});
common.expectsError(
() => {
fs._toUnixTimestamp({});
},
{
code: 'ERR_INVALID_ARG_TYPE',
type: Error
});
const okInputs = [1, -1, '1', '-1', Date.now()];
okInputs.forEach((input) => {
assert.doesNotThrow(() => fs._toUnixTimestamp(input));
});