blob: 1fe0294f68b714d19a5f22499e169ebb4d27b2d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
'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);
});
|