2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 06:16:07 +00:00

Closes #204: Fix handling fs.readStream.path if it's a buffer

This commit is contained in:
Gocho Mugo
2016-10-10 15:08:15 +03:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -200,6 +200,16 @@ describe('Telegram', function telegramSuite() {
});
});
describe('#_formatSendData', function _formatSendData() {
it('should handle buffer path from fs.readStream', function test() {
const bot = new Telegram(TOKEN);
const photo = fs.createReadStream(Buffer.from(`${__dirname}/bot.gif`));
return bot.sendPhoto(USERID, photo).then(resp => {
assert.ok(is.object(resp));
});
});
});
describe('#sendPhoto', function sendPhotoSuite() {
let photoId;
it('should send a photo from file', function test() {