first commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { formatBytes, slugify } from "@/lib/format";
|
||||
|
||||
describe("@ alias resolution", () => {
|
||||
it("resolves @/lib/format and calls its exports", () => {
|
||||
expect(formatBytes(0)).toBe("0 B");
|
||||
expect(formatBytes(1536)).toBe("1.5 KB");
|
||||
expect(slugify("Hello, World!")).toBe("hello-world");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
describe("test infrastructure", () => {
|
||||
it("runs in a jsdom environment with a mutable document", () => {
|
||||
expect(document.body).toBeInstanceOf(HTMLElement);
|
||||
|
||||
const marker = document.createElement("div");
|
||||
marker.id = "jsdom-marker";
|
||||
document.body.appendChild(marker);
|
||||
|
||||
expect(document.getElementById("jsdom-marker")).toBe(marker);
|
||||
});
|
||||
|
||||
it("registers the jest-dom matchers", () => {
|
||||
const el = document.createElement("p");
|
||||
el.textContent = "hello from jest-dom";
|
||||
document.body.appendChild(el);
|
||||
|
||||
expect(el).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user