Personal Telegram developer console for GitHub
test: remove one-time callback webhook setup test
davoodmehraban89 committed
Oct 2, 2026 at 19:40 UTC
7cc63ebc89705efd82cea0777ffd5dad5496b516
1 file changed
-34
test/webhook-callback-setup.test.js
deleted
-34
@@ -1,34 +0,0 @@
1
-import test from "node:test";
2
-import assert from "node:assert/strict";
3
-import worker from "../src/index.js";
4
-
5
-test("temporary setup registers callback_query updates with Telegram", async () => {
6
- const req = new Request("https://nexa-dev-bot.example.workers.dev/telegram/setup", {
7
- method: "GET",
8
- });
9
-
10
- let captured;
11
- globalThis.fetch = async (url, init) => {
12
- captured = {
13
- url: String(url),
14
- body: JSON.parse(init.body),
15
- };
16
- return new Response(JSON.stringify({ ok: true, result: true }), {
17
- status: 200,
18
- headers: { "content-type": "application/json" },
19
- });
20
- };
21
-
22
- const res = await worker.fetch(req, {
23
- TELEGRAM_WEBHOOK_SECRET: "secret",
24
- TELEGRAM_BOT_TOKEN: "token",
25
- });
26
-
27
- assert.equal(res.status, 200);
28
- assert.equal(captured.url, "https://api.telegram.org/bottoken/setWebhook");
29
- assert.deepEqual(captured.body, {
30
- url: "https://nexa-dev-bot.example.workers.dev/telegram/webhook",
31
- secret_token: "secret",
32
- allowed_updates: ["message", "callback_query"],
33
- });
34
-});