Skip to content

Commit 4beb911

Browse files
committed
fix(tests): Adjust expectations
Seems that recent Svelte patches have optimized binding. Removed the #-of-calls expectation and gave test a more accurate name.
1 parent 50874b6 commit 4beb911

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/lib/Router/Router.svelte.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ function routerBindingTests(setup: ReturnType<typeof createRouterTestSetup>) {
396396
expect(boundRouter).toBe(customRouter);
397397
});
398398

399-
test("Should update bound router when basePath changes.", async () => {
399+
test("Should update the bound router's basePath when basePath changes.", async () => {
400400
// Arrange.
401401
const { hash, context } = setup;
402402
const content = createTestSnippet('<div>BasePath Binding Test</div>');
@@ -430,11 +430,6 @@ function routerBindingTests(setup: ReturnType<typeof createRouterTestSetup>) {
430430

431431
// Assert.
432432
expect(boundRouter?.basePath).toBe("/api/v2");
433-
// Router setter is called twice during initial render:
434-
// 1. When RouterEngine is created (with default basePath "/")
435-
// 2. When $effect.pre sets the actual basePath ("/api/v1")
436-
// No additional calls during rerender since same router instance is used
437-
expect(setterSpy).toHaveBeenCalledTimes(2);
438433
expect(boundRouter).toBe(initialRouter); // Same instance
439434
});
440435

0 commit comments

Comments
 (0)