feat: add support for route groups (#1563)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user