-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Expand file tree
/
Copy pathsmoke.test.js
More file actions
28 lines (23 loc) · 997 Bytes
/
smoke.test.js
File metadata and controls
28 lines (23 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { join } from "node:path";
const root = import.meta.dir;
const read = (path) => readFileSync(join(root, path), "utf8");
describe("Farcaster miniapp shell", () => {
test("initializes the Farcaster SDK before showing chat", () => {
const app = read("src/App.tsx");
expect(app).toContain('from "@farcaster/miniapp-sdk"');
expect(app).toContain("sdk.actions.ready()");
expect(app).toContain("<LoadingScreen");
expect(app).toContain("<ElizaChat");
expect(app).toContain("Retry");
});
test("keeps the local API chat-only with in-memory sessions", () => {
const server = read("server.js");
expect(server).toContain('app.get("/health"');
expect(server).toContain('app.post("/api/chat/eliza"');
expect(server).toContain("const sessions = new Map()");
expect(server).toContain("getOrCreateSession");
expect(server).toContain("buildReply");
});
});