Skip to content

Commit a124954

Browse files
migrate serialization test to vitest
1 parent ef5faf2 commit a124954

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

typescript/tests/serialization.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import "@testing-library/jest-dom";
2+
13
import * as fs from "fs";
24
import * as path from "path";
35
import * as JSON5 from "json5";
46
import { loadJson, deepClone } from "../src/utils/json";
7+
import { describe, it, expect } from "vitest";
58

69
// Path to the example page JSON file
710
const PAGE_PATH = path.resolve(__dirname, "../../schema/page/ex1_success.json");
@@ -19,7 +22,7 @@ describe("JSON-DOC Utilities", () => {
1922
}
2023
}
2124

22-
test("should load JSON correctly", () => {
25+
it("should load JSON correctly", () => {
2326
const testData = { hello: "world", nested: { value: 42 } };
2427
const jsonString = JSON.stringify(testData);
2528

@@ -32,7 +35,7 @@ describe("JSON-DOC Utilities", () => {
3235
expect(loadedObj).toEqual(testData);
3336
});
3437

35-
test("should deep clone objects", () => {
38+
it("should deep clone objects", () => {
3639
const original = {
3740
hello: "world",
3841
nested: { value: 42, array: [1, 2, 3] },
@@ -52,7 +55,7 @@ describe("JSON-DOC Utilities", () => {
5255
expect(original.nested.value).toBe(42);
5356
});
5457

55-
test("should load example page from schema", () => {
58+
it("should load example page from schema", () => {
5659
// Load the example page from the schema
5760
const content = loadJsonFile(PAGE_PATH);
5861

typescript/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
"tests/**/*.ts",
3232
"scripts/**/*.ts"
3333
],
34-
"exclude": ["node_modules", "dist", "src/serialization/**"]
34+
"exclude": ["node_modules", "dist"]
3535
}

0 commit comments

Comments
 (0)