Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Borodin committed Oct 1, 2024
1 parent 4ed48d0 commit 08761a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "commonjs",
"name": "typescript-telegram-bot-api",
"version": "0.3.5",
"version": "0.3.6",
"description": "Telegram Bot API wrapper for Node.js written in TypeScript",
"repository": "github:Borodin/typescript-telegram-bot-api",
"main": "dist/index.js",
Expand Down
9 changes: 9 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ describe('TelegramBot', () => {
}).getMe(),
).rejects.toThrow(/getaddrinfo (ENOTFOUND|EAI_AGAIN) invalid_url/);
});

it('should throw "401 Unauthorized" error with a valid botToken', async () => {
await expect(
new TelegramBot({
botToken: TOKEN,
testEnvironment: true,
}).getMe(),
).rejects.toThrow('401 Unauthorized');
});
});

describe('.processUpdate()', () => {
Expand Down

0 comments on commit 08761a2

Please sign in to comment.