Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
17 lines
424 B
Plaintext
17 lines
424 B
Plaintext
'use strict'
|
|
|
|
process.env.TZ = 'UTC'
|
|
|
|
const { test } = require('node:test')
|
|
const isValidDate = require('./is-valid-date')
|
|
|
|
test('returns true for valid dates', t => {
|
|
t.assert.strictEqual(isValidDate(new Date()), true)
|
|
})
|
|
|
|
test('returns false for non-dates and invalid dates', t => {
|
|
t.plan(2)
|
|
t.assert.strictEqual(isValidDate('20210621'), false)
|
|
t.assert.strictEqual(isValidDate(new Date('2021-41-99')), false)
|
|
})
|