feat: add support for route groups (#1563)

This commit is contained in:
Marvin Hagemeister
2023-08-02 09:51:20 +02:00
committed by GitHub
parent 4b28e2e269
commit e4d797ae4e
17 changed files with 384 additions and 218 deletions
+18
View File
@@ -1,5 +1,6 @@
import { colors } from "$fresh/src/server/deps.ts";
import {
assertEquals,
delay,
DOMParser,
HTMLElement,
@@ -39,6 +40,23 @@ export function assertSelector(doc: Document, selector: string) {
}
}
export function assertTextMany(
doc: Document,
selector: string,
expected: string[],
) {
const texts = Array.from(doc.querySelectorAll(selector)).map((el) =>
el.textContent
);
try {
assertEquals(texts, expected);
} catch (err) {
const html = "\n\n" + prettyDom(doc);
throw new err.constructor(err.message += html, { cause: err });
}
}
export const VOID_ELEMENTS =
/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;
function prettyDom(doc: Document) {