Skip to content

Commit 1436903

Browse files
committed
Add new test
1 parent 6b579bc commit 1436903

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/tests/src/e2e/server-function.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,9 @@ test.describe("server-function", () => {
6767
await page.goto("http://localhost:3000/generator-server-function");
6868
await expect(page.locator("#server-fn-test")).toContainText("¡Hola, Mundo!");
6969
});
70+
71+
test("should remove exports for non-function values when top-level use server is used", async ({ page }) => {
72+
await page.goto("http://localhost:3000/server-function-query-toplevel");
73+
await expect(page.locator("#server-fn-test")).toContainText('false');
74+
});
7075
});

apps/tests/src/routes/server-function-query-toplevel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { createEffect, createSignal } from "solid-js";
22
import * as testModule from "~/functions/solid-router-query";
33

44
export default function App() {
5-
const [output, setOutput] = createSignal<{ serverFnWithMeta?: boolean }>({});
5+
const [output, setOutput] = createSignal<boolean | null>();
66

77
createEffect(() => {
8-
setOutput(prev => ({ ...prev, serverFnWithMeta: 'testQuery' in testModule }));
8+
setOutput('testQuery' in testModule);
99
});
1010

1111
return (

apps/tests/test-results/.last-run.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)