Skip to content

Commit 08761a2

Browse files
committed
add tests
1 parent 4ed48d0 commit 08761a2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "commonjs",
33
"name": "typescript-telegram-bot-api",
4-
"version": "0.3.5",
4+
"version": "0.3.6",
55
"description": "Telegram Bot API wrapper for Node.js written in TypeScript",
66
"repository": "github:Borodin/typescript-telegram-bot-api",
77
"main": "dist/index.js",

tests/index.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ describe('TelegramBot', () => {
5151
}).getMe(),
5252
).rejects.toThrow(/getaddrinfo (ENOTFOUND|EAI_AGAIN) invalid_url/);
5353
});
54+
55+
it('should throw "401 Unauthorized" error with a valid botToken', async () => {
56+
await expect(
57+
new TelegramBot({
58+
botToken: TOKEN,
59+
testEnvironment: true,
60+
}).getMe(),
61+
).rejects.toThrow('401 Unauthorized');
62+
});
5463
});
5564

5665
describe('.processUpdate()', () => {

0 commit comments

Comments
 (0)