Merge pull request #977 from pano9000/test_vitest

test: add vitest as test framework and port current tests
This commit is contained in:
Elian Doran
2025-01-17 22:22:00 +02:00
committed by GitHub
20 changed files with 1614 additions and 135 deletions

View File

@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import markdownExportService from "./md.js";
import { trimIndentation } from "../../../spec/support/utils.js";

View File

@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import { trimIndentation } from "../../../spec/support/utils.js";
import markdownService from "./markdown.js";

View File

@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import { renderCode, type Result } from "./content_renderer.js";
describe("content_renderer", () => {
@@ -8,7 +9,7 @@ describe("content_renderer", () => {
content: " "
};
renderCode(emptyResult);
expect(emptyResult.isEmpty).toBeTrue();
expect(emptyResult.isEmpty).toBeTruthy();
});
it("identifies unsupported content type", () => {
@@ -17,7 +18,7 @@ describe("content_renderer", () => {
content: Buffer.from("Hello world")
};
renderCode(emptyResult);
expect(emptyResult.isEmpty).toBeTrue();
expect(emptyResult.isEmpty).toBeTruthy();
});
it("wraps code in <pre>", () => {