Tests cases for #56

experimental
Yago 10 years ago
parent b46ea1d9a6
commit fd4cf4e353
  1. 27
      test/index.js

@ -197,6 +197,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a photo from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var photo = fs.readFileSync(__dirname+'/bot.gif');
bot.sendPhoto(USERID, photo).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendChatAction', function () {
@ -260,6 +269,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a document from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var document = fs.readFileSync(__dirname+'/bot.gif');
bot.sendDocument(USERID, document).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendSticker', function () {
@ -300,6 +318,15 @@ describe('Telegram', function () {
done();
});
});
it('should send a sticker from a Buffer', function (done) {
var bot = new Telegram(TOKEN);
var sticker = fs.readFileSync(__dirname+'/sticker.webp');
bot.sendDocument(USERID, sticker).then(function (resp) {
resp.should.be.an.instanceOf(Object);
done();
});
});
});
describe('#sendVideo', function () {

Loading…
Cancel
Save