d68f003000
CI / Change detection (push) Has been cancelled
CI / Version drift (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Workflow RLM cache (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / npm wrapper smoke (push) Has been cancelled
CI / Mobile runtime smoke (push) Has been cancelled
CI / Workflow lint (push) Has been cancelled
CI / Documentation (push) Has been cancelled
Web Frontend / Lint & Type Check (push) Failing after 1s
Auto-close harvested PRs / close (push) Failing after 1s
cargo-deny / cargo-deny (bans licenses sources) (push) Failing after 1s
Security audit / cargo-audit (push) Failing after 1s
Sync to CNB / sync (push) Failing after 1s
cargo-deny / cargo-deny (advisories) (push) Failing after 3s
Web Frontend / Deploy to Cloudflare (push) Has been cancelled
24 lines
930 B
JavaScript
24 lines
930 B
JavaScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
test("ThreadStore is initialized before bridge startup polls Telegram", async () => {
|
|
const source = await fs.readFile(path.join(__dirname, "../src/index.mjs"), "utf8");
|
|
const declaration = source.indexOf("class ThreadStore");
|
|
const startupUse = source.indexOf("await ThreadStore.open");
|
|
const pollCall = source.indexOf("await pollTelegram()");
|
|
const reattachCall = source.indexOf("reattachActiveTurns().catch");
|
|
|
|
assert.notEqual(declaration, -1);
|
|
assert.notEqual(startupUse, -1);
|
|
assert.notEqual(pollCall, -1);
|
|
assert.notEqual(reattachCall, -1);
|
|
assert.ok(declaration < startupUse);
|
|
assert.ok(startupUse < reattachCall);
|
|
assert.ok(reattachCall < pollCall);
|
|
});
|