Skip to content

Commit 77263ab

Browse files
committed
Add new test
1 parent ffc9889 commit 77263ab

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ test.describe("server-function", () => {
8080
test("should build with a server function w/ blob data", async ({ page }) => {
8181
await page.goto("http://localhost:3000/server-function-blob");
8282
await expect(page.locator("#server-fn-test")).toContainText('{"result":true}');
83+
test("should remove exports for non-function values when top-level use server is used", async ({ page }) => {
84+
await page.goto("http://localhost:3000/server-function-query-toplevel");
85+
await expect(page.locator("#server-fn-test")).toContainText('false');
8386
});
8487
});

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)