-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use vitest to run test on libs
- Loading branch information
Showing
2 changed files
with
11 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { dateSchema } from "./model"; | ||
import { expect, test } from "vitest"; | ||
|
||
describe("Timestamp should be coerced and parsed as Date", () => { | ||
it("should work", () => { | ||
const date = new Date(); | ||
const dateStr = date.getTime(); | ||
const parsed = dateSchema.safeParse(dateStr); | ||
expect(parsed.success).toBe(true); | ||
if (!parsed.success) return; | ||
expect(parsed.data).toBeInstanceOf(Date); | ||
}); | ||
test("Timestamp should be coerced and parsed as Date", () => { | ||
const date = new Date(); | ||
const dateStr = date.getTime(); | ||
const parsed = dateSchema.safeParse(dateStr); | ||
expect(parsed.success).toBe(true); | ||
if (!parsed.success) return; | ||
expect(parsed.data).toBeInstanceOf(Date); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { Months } from "./recnet-date-fns"; | ||
import { expect, test } from "vitest"; | ||
|
||
describe("Should have 12 months", () => { | ||
it("should work", () => { | ||
expect(Months.length).toEqual(12); | ||
}); | ||
test("Should have 12 months", () => { | ||
expect(Months.length).toEqual(12); | ||
}); |