Skip to content

Commit 35560f8

Browse files
committed
Fix floating bug in test
PR-URL: #99
1 parent 435f1df commit 35560f8

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Add function `nowDateTimeUTC(date?: Date, timeSep?: string): string`
66
- Add case functions: `toLower`, `toCamel`, `spinalToCamel`, and `snakeToCamel`
7+
- Fixed floating bug in tests for `nowDateTimeUTC`
78

89
## [3.5.16][] - 2021-10-10
910

test/utilities.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,10 @@ metatests.case(
293293
],
294294
],
295295
'metautil.nowDateTimeUTC': [
296-
[undefined, new Date().toISOString().split('.')[0]],
296+
[undefined, (s) => s.length === 'YYYY-MM-DDThh:mm:ss'.length],
297297
[new Date('2021-10-15T20:54:18.713Z'), '2021-10-15T20:54:18'],
298298
[new Date('2020-12-01T01:15:30+03:00'), '2020-11-30T22:15:30'],
299-
[
300-
undefined,
301-
'-',
302-
new Date().toISOString().replace(/:/g, '-').split('.')[0],
303-
],
299+
[undefined, '-', (s) => s.length === 'YYYY-MM-DDThh:mm:ss'.length],
304300
[new Date('2021-10-15T20:54:18.713Z'), '-', '2021-10-15T20-54-18'],
305301
[new Date('2020-12-01T01:15:30+03:00'), '-', '2020-11-30T22-15-30'],
306302
],

0 commit comments

Comments
 (0)