mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
fix(javascript): retain endpoint candidates through graph projection
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import { analyzeJavaScriptStaticSource } from "./javascriptStaticAnalysis.js";
|
||||
|
||||
it("reads exact route-property templates and leaves interpolated values unknown", () => {
|
||||
const analysis = analyzeJavaScriptStaticSource(`
|
||||
const routes = [
|
||||
{ path: \`settings\` },
|
||||
{ route: \`users/\${userId}\` },
|
||||
{ path: "/login" },
|
||||
];
|
||||
`);
|
||||
|
||||
expect(
|
||||
analysis.endpoints.map(({ value, mechanism, interpretation }) => ({
|
||||
value,
|
||||
mechanism,
|
||||
interpretation,
|
||||
})),
|
||||
).toEqual([
|
||||
{
|
||||
value: "settings",
|
||||
mechanism: "property:path",
|
||||
interpretation: undefined,
|
||||
},
|
||||
{
|
||||
value: "/login",
|
||||
mechanism: "property:path",
|
||||
interpretation: undefined,
|
||||
},
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user