diff options
| author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
| commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
| tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/es5-ext/test/date | |
| parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) | |
upgrade dependencies
Diffstat (limited to 'node_modules/es5-ext/test/date')
| -rw-r--r-- | node_modules/es5-ext/test/date/ensure-time-value.js | 14 | ||||
| -rw-r--r-- | node_modules/es5-ext/test/date/is-time-value.js | 15 |
2 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/es5-ext/test/date/ensure-time-value.js b/node_modules/es5-ext/test/date/ensure-time-value.js new file mode 100644 index 000000000..39ddc23c4 --- /dev/null +++ b/node_modules/es5-ext/test/date/ensure-time-value.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(12), 12, "Number in range"); + a(t(12.23), 12, "Rounds number in range"); + a(t(-12.63), -12, "Rounds negative number in range"); + a.throws( + function () { + t(NaN); + }, + TypeError, + "Throws on invalid" + ); +}; diff --git a/node_modules/es5-ext/test/date/is-time-value.js b/node_modules/es5-ext/test/date/is-time-value.js new file mode 100644 index 000000000..a21677c06 --- /dev/null +++ b/node_modules/es5-ext/test/date/is-time-value.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), true, "Number in range"); + a(t(true), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t({}), false, "Plain object"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); + a(t(8.64e17), false, "Beyond range"); + a(t(8.64e15), true, "Below range"); + a(t(-8.64e17), false, "Negative beyond range"); + a(t(-8.64e15), true, "Negative below range"); +}; |
