Skip to content

Commit

Permalink
test: Add test for TelegramBot#sendDocument() using 'fileOpts' param
Browse files Browse the repository at this point in the history
References:

  * Original PR: yagop/node-telegram-bot-api#152
  * Original Author: @evolun
  • Loading branch information
passion-27 committed Feb 3, 2017
1 parent b59ca7d commit d6409dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ describe('TelegramBot', function telegramSuite() {
assert.ok(is.object(resp.document));
});
});
it('should send a document with custom file options', function test() {
const document = fs.createReadStream(`${__dirname}/data/photo.gif`);
const fileOpts = { filename: 'customfilename.gif' };
return bot.sendDocument(USERID, document, {}, fileOpts).then(resp => {
assert.equal(resp.document.file_name, fileOpts.filename);
});
});
});

describe('#sendSticker', function sendStickerSuite() {
Expand Down

0 comments on commit d6409dd

Please sign in to comment.