@richie-router/server 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.test.cjs +11 -0
- package/dist/esm/index.test.mjs +11 -0
- package/package.json +1 -1
package/dist/cjs/index.test.cjs
CHANGED
|
@@ -68,6 +68,17 @@ function createTestArtifacts(options) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
import_bun_test.describe("handleSpaRequest", () => {
|
|
71
|
+
import_bun_test.test('treats "/" as the root basePath and trims trailing slashes', () => {
|
|
72
|
+
const { spaRoutesManifest } = createTestArtifacts();
|
|
73
|
+
import_bun_test.expect(import__.matchesSpaPath("/about", {
|
|
74
|
+
spaRoutesManifest,
|
|
75
|
+
basePath: "/"
|
|
76
|
+
})).toBe(true);
|
|
77
|
+
import_bun_test.expect(import__.matchesSpaPath("/project/about", {
|
|
78
|
+
spaRoutesManifest,
|
|
79
|
+
basePath: "/project/"
|
|
80
|
+
})).toBe(true);
|
|
81
|
+
});
|
|
71
82
|
import_bun_test.test("exposes a pure SPA matcher for host-side routing decisions", () => {
|
|
72
83
|
const { spaRoutesManifest, routeManifest } = createTestArtifacts();
|
|
73
84
|
import_bun_test.expect(import__.matchesSpaPath("/project/about", {
|
package/dist/esm/index.test.mjs
CHANGED
|
@@ -68,6 +68,17 @@ function createTestArtifacts(options) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
describe("handleSpaRequest", () => {
|
|
71
|
+
test('treats "/" as the root basePath and trims trailing slashes', () => {
|
|
72
|
+
const { spaRoutesManifest } = createTestArtifacts();
|
|
73
|
+
expect(matchesSpaPath("/about", {
|
|
74
|
+
spaRoutesManifest,
|
|
75
|
+
basePath: "/"
|
|
76
|
+
})).toBe(true);
|
|
77
|
+
expect(matchesSpaPath("/project/about", {
|
|
78
|
+
spaRoutesManifest,
|
|
79
|
+
basePath: "/project/"
|
|
80
|
+
})).toBe(true);
|
|
81
|
+
});
|
|
71
82
|
test("exposes a pure SPA matcher for host-side routing decisions", () => {
|
|
72
83
|
const { spaRoutesManifest, routeManifest } = createTestArtifacts();
|
|
73
84
|
expect(matchesSpaPath("/project/about", {
|