@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.
@@ -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", {
@@ -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", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@richie-router/server",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Server helpers for Richie Router head tags and document handling",
5
5
  "sideEffects": false,
6
6
  "exports": {