Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions e2e/__snapshots__/hast.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`%name { name: 'complete.json' } > hast 1`] = `
exports[`%name > hast 1`] = `
{
"type": "root",
"children": [
Expand Down Expand Up @@ -2324,7 +2324,7 @@ exports[`%name { name: 'complete.json' } > hast 1`] = `
}
`;

exports[`%name { name: 'complete.json' } > hast without styles 1`] = `
exports[`%name > hast without styles 1`] = `
{
"type": "root",
"children": [
Expand Down
6 changes: 3 additions & 3 deletions e2e/__snapshots__/html.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`%name { name: 'complete.json' } > html 1`] = `
exports[`%name > html 1`] = `
<h1 class="heading-1" id="named-styles">Named styles</h1>
<h1 class="title" id="title">Title</h1>
<p class="subtitle" id="h.l7ftux4f1oct">Subtitle</p>
Expand Down Expand Up @@ -496,7 +496,7 @@ exports[`%name { name: 'complete.json' } > html 1`] = `

`;

exports[`%name { name: 'complete.json' } > html without styles 1`] = `
exports[`%name > html without styles 1`] = `
<h1 class="heading-1" id="named-styles">Named styles</h1>
<h1 class="title" id="title">Title</h1>
<p class="subtitle" id="h.l7ftux4f1oct">Subtitle</p>
Expand Down
4 changes: 2 additions & 2 deletions e2e/hast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import path from "path";

import { describe, expect, test } from "vitest";

import { toHast } from "../src";
import { FIXTURES_DIR, CASES } from "./cases";
import { toHast } from "../src/index.js";
import { FIXTURES_DIR, CASES } from "./cases.js";

expect.addSnapshotSerializer({
serialize(val) {
Expand Down
12 changes: 6 additions & 6 deletions e2e/html.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import rehypeStringify from "rehype-stringify";
import { unified } from "unified";
import { describe, expect, test } from "vitest";

import { toHast } from "../src";
import { CASES, FIXTURES_DIR } from "./cases";
import { toHast } from "../src/index.js";
import { CASES, FIXTURES_DIR } from "./cases.js";

import type { Root } from "hast";

Expand All @@ -41,15 +41,15 @@ describe.each(CASES)("%name", ({ name }) => {
fs.readFileSync(path.join(FIXTURES_DIR, name), "utf8")
);

test("html", () => {
const output = prettier.format(html(toHast(doc)), { parser: "html" });
test("html", async () => {
const output = await prettier.format(html(toHast(doc)), { parser: "html" });
fs.mkdirSync(path.join(__dirname, "__html__"), { recursive: true });
fs.writeFileSync(path.join(__dirname, "__html__", `${name}.html`), output);
expect(output).toMatchSnapshot();
});

test("html without styles", () => {
const output = prettier.format(html(toHast(doc, { styles: false })), {
test("html without styles", async () => {
const output = await prettier.format(html(toHast(doc, { styles: false })), {
parser: "html",
});
fs.mkdirSync(path.join(__dirname, "__html__"), { recursive: true });
Expand Down
Loading