aboutsummaryrefslogtreecommitdiff
path: root/test/manual
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-27 00:13:06 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commit3607b5523f9d23ec6b9facf8474c7bdf047537e1 (patch)
tree87c433788599b1f414cb248759f2eed6500071e2 /test/manual
parent84ebb018f59ab5efe8bc97e8e4b87435d6665b0b (diff)
chore(build): split tsconfig, typecheck tests, add node:test runner
test/ was never type-checked and had no runner. Adds tsconfig.base.json shared by a src project and a test project, an npm test script scoped to non-manual suites, and a CI step. Ports the profile store suite as proof. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test/manual')
-rw-r--r--test/manual/bridge-test.ts6
-rw-r--r--test/manual/daemon-transport-test.ts2
-rw-r--r--test/manual/ipc-server-test.ts9
3 files changed, 10 insertions, 7 deletions
diff --git a/test/manual/bridge-test.ts b/test/manual/bridge-test.ts
index ecb4100..5402aae 100644
--- a/test/manual/bridge-test.ts
+++ b/test/manual/bridge-test.ts
@@ -3,7 +3,7 @@
* Requires: Chrome with remote debugging enabled (chrome://inspect/#remote-debugging).
* Run: npx tsx test/manual/bridge-test.ts
*/
-import { createCdpBridge, type SendToClient, type CdpBridge } from "../../src/daemon/bridge";
+import { createCdpBridge, type SendToClient } from "../../src/daemon/bridge";
import type { WireRequest, WireResponse, WireEvent } from "../../src/daemon/protocol";
let passed = 0;
@@ -35,12 +35,12 @@ async function main() {
const events: WireEvent[] = [];
let eventCount = 0;
- const send: SendToClient = (clientId, msg) => {
+ const send: SendToClient = (_clientId, msg) => {
if (msg.type === "response") responses.push(msg);
else events.push(msg);
};
- bridge.onEvent((evt, _targets) => { eventCount++; });
+ bridge.onEvent((_evt, _targets) => { eventCount++; });
const req1: WireRequest = { type: "request", id: 1, method: "Target.getTargets" };
bridge.handleRequest(req1, "pi-test", send);
diff --git a/test/manual/daemon-transport-test.ts b/test/manual/daemon-transport-test.ts
index 4ba2f5b..e9660c8 100644
--- a/test/manual/daemon-transport-test.ts
+++ b/test/manual/daemon-transport-test.ts
@@ -7,7 +7,7 @@
*/
import { createIpcServer } from "../../src/daemon/server";
import { createDaemonTransport } from "../../src/cdp/daemon-transport";
-import { DAEMON_SOCKET_PATH, serialize } from "../../src/daemon/protocol";
+import { DAEMON_SOCKET_PATH } from "../../src/daemon/protocol";
import type { WireMessage } from "../../src/daemon/protocol";
import { unlinkSync } from "node:fs";
diff --git a/test/manual/ipc-server-test.ts b/test/manual/ipc-server-test.ts
index a267a45..b4da3df 100644
--- a/test/manual/ipc-server-test.ts
+++ b/test/manual/ipc-server-test.ts
@@ -7,7 +7,7 @@ import { createConnection } from "node:net";
import { createInterface } from "node:readline";
import { createIpcServer } from "../../src/daemon/server";
import { DAEMON_SOCKET_PATH } from "../../src/daemon/protocol";
-import type { WireMessage } from "../../src/daemon/protocol";
+import type { WireEvent, WireMessage } from "../../src/daemon/protocol";
const TEST_CLIENT_ID = "pi-test-001";
@@ -76,7 +76,11 @@ async function main() {
// ── Test 4: Broadcast ─────────────────────────────────────────────────
receivedByClient.length = 0;
- const broadcastMsg = { type: "event", method: "Target.targetCreated", params: { targetInfo: { type: "page" } } };
+ const broadcastMsg: WireEvent = {
+ type: "event",
+ method: "Target.targetCreated",
+ params: { targetInfo: { type: "page" } },
+ };
server.broadcast(broadcastMsg);
await sleep(200);
@@ -93,7 +97,6 @@ async function main() {
// ── Test 6: Re-registration (same clientId after disconnect) ──────────
const socket2 = createConnection(DAEMON_SOCKET_PATH);
- const rl2 = createInterface({ input: socket2, crlfDelay: Infinity });
await new Promise<void>((resolve) => socket2.on("connect", resolve));
socket2.write(JSON.stringify({ type: "control", action: "register", clientId: TEST_CLIENT_ID }) + "\n");