1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-20 21:13:43 +02:00
.profile/packages/utils/src/test/dates.test.ts

20 lines
509 B
TypeScript

import assert from "node:assert/strict"
import { describe, it } from "node:test"
import { getISODate } from "../dates.ts"
describe("dates", () => {
describe("getISODate", () => {
it("should return the correct date in ISO format (e.g: 2012-05-23)", () => {
// Arrange - Given
const input = new Date("2012-05-23")
// Act - When
const output = getISODate(input)
// Assert - Then
const expected = "2012-05-23"
assert.strictEqual(output, expected)
})
})
})