Skip to content

Commit e4d6287

Browse files
committed
test: add back compiler snapshot!
1 parent e370538 commit e4d6287

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

β€Žtest/find.test.tsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, it, expect } from "vitest";
22
import { createRouter, formatTree } from "./_utils.ts";
33
import { findRoute, removeRoute } from "../src/index.ts";
44
import { compileRouter } from "../src/compiler.ts";
5+
import { format } from "prettier";
56

67
describe("route matching", () => {
78
const router = createRouter([
@@ -21,7 +22,7 @@ describe("route matching", () => {
2122

2223
const compiledLookup = compileRouter(router);
2324

24-
it("snapshot", () => {
25+
it("snapshot", async () => {
2526
expect(formatTree(router.root)).toMatchInlineSnapshot(`
2627
"<root>
2728
β”œβ”€β”€ /test β”ˆ> [GET] /test
@@ -40,6 +41,10 @@ describe("route matching", () => {
4041
β”œβ”€β”€ /wildcard
4142
β”‚ β”œβ”€β”€ /** β”ˆ> [GET] /wildcard/**"
4243
`);
44+
45+
await expect(
46+
await format(compiledLookup.toString(), { parser: "acorn" }),
47+
).toMatchFileSnapshot(".snapshot/compiler.mjs");
4348
});
4449

4550
const lookups = [

0 commit comments

Comments
Β (0)