test: Add test for TelegramBot#sendDocument() using 'fileOpts' param

References:

  * Original PR: https://github.com/yagop/node-telegram-bot-api/pull/152
  * Original Author: @evolun
experimental
GochoMugo 9 years ago
parent 9d12bdfa41
commit 14f37c7181
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
  1. 7
      test/telegram.js

@ -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() {

Loading…
Cancel
Save