Personal Telegram developer console for GitHub
test: allow temporary webhook reconfiguration route
davoodmehraban89 committed
Oct 2, 2026 at 19:30 UTC
d328515dc69d464a587bd5e6cacde93012da3ea5
1 file changed
-20
test/security.test.js
-20
@@ -81,26 +81,6 @@ test("unauthorized Telegram users receive no bot response", async () => {
81
assert.equal(calls, 0);
82
});
83
84
-test("temporary setup endpoint is disabled after webhook registration", async () => {
85
- const req = new Request("https://nexa-dev-bot.example.workers.dev/telegram/setup", {
86
- method: "GET",
87
- });
88
-
89
- let calls = 0;
90
- globalThis.fetch = async () => {
91
- calls += 1;
92
- throw new Error("setup endpoint must not call Telegram after registration");
93
- };
94
-
95
- const res = await worker.fetch(req, {
96
- TELEGRAM_WEBHOOK_SECRET: "secret",
97
- TELEGRAM_BOT_TOKEN: "token",
98
- });
99
-
100
- assert.equal(res.status, 404);
101
- assert.equal(calls, 0);
102
-});
103
-
84
test("temporary diagnostic command no longer exposes Telegram ID", async () => {
85
const req = telegramRequest("right", {
86
message: { text: "/diag", from: { id: 123 }, chat: { id: 123 } },