-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from mateothegreat/feat/base-path
added support for basePath
- Loading branch information
Showing
8 changed files
with
642 additions
and
886 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
import { Instance } from './instance.svelte'; | ||
|
||
const instance1 = new Instance("", [ | ||
{ | ||
path: "/1a", | ||
component: "1a", | ||
}, | ||
{ | ||
path: "/1b", | ||
component: "1b", | ||
}, | ||
]); | ||
|
||
const instance2 = new Instance("/foo", [ | ||
{ | ||
path: "/2a", | ||
component: "2a", | ||
}, | ||
{ | ||
path: "/2b", | ||
component: "2b", | ||
}, | ||
]); | ||
|
||
describe("Instance.routes", () => { | ||
it("should navigate", async () => { | ||
expect(await instance1.get("/1a").path).toEqual(instance1.routes[0].path); | ||
expect(await instance2.get("/2a").path).toEqual(instance2.routes[0].path); | ||
expect(await instance1.get("/1b").path).toEqual(instance1.routes[1].path); | ||
expect(await instance2.get("/foo/2b").path).toEqual(instance2.routes[1].path); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="bg-indigo-400 p-10"> | ||
<h1>/bar path off of basePath: /foo</h1> | ||
</div> |