one
Version:
One is a new React Framework that makes Vite serve both native and web.
20 lines (19 loc) • 768 B
JavaScript
import { describe, expect, it } from "vitest";
import { getTypedRoutesDeclarationFile } from "./getTypedRoutesDeclarationFile.mjs";
function createRouteContext(paths) {
const context = () => ({
default() {}
});
Object.defineProperty(context, "keys", {
value: () => paths
});
return context;
}
describe(getTypedRoutesDeclarationFile, () => {
it("does not emit trailing whitespace for multi-line route unions", () => {
const declaration = getTypedRoutesDeclarationFile(createRouteContext(["./index+ssg.tsx", "./about+ssg.tsx", "./[slug]+ssg.tsx"]));
expect(declaration).toContain(" StaticRoutes:\n | `/`");
expect(declaration).not.toMatch(/[ \t]+$/m);
});
});
//# sourceMappingURL=getTypedRoutesDeclarationFile.test.mjs.map