2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 06:16:07 +00:00
This commit is contained in:
Yago
2015-09-27 11:18:25 +02:00
parent 48045b98ff
commit 6a679b5644
7 changed files with 46 additions and 14 deletions

12
test/.jshintrc Normal file
View File

@@ -0,0 +1,12 @@
{
"mocha" : true,
"curly" : true,
"eqeqeq" : true,
"indent" : 2,
"latedef" : true,
"newcap" : true,
"quotmark": "single",
"strict" : true,
"undef" : true,
"node" : true
}

View File

@@ -1,10 +1,12 @@
'use strict';
var TelegramPolling = require('../src/telegramPolling');
var Telegram = require('../index');
var request = require('request');
var should = require('should');
var fs = require('fs');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
var TOKEN = process.env.TEST_TELEGRAM_TOKEN;
if (!TOKEN) {
throw new Error('Bot token not provided');
@@ -69,7 +71,7 @@ describe('Telegram', function () {
method: 'POST',
json: true,
headers: {
"content-type": "application/json",
'content-type': 'application/json',
},
body: {update_id: 0, message: {text: 'test'}}
});
@@ -94,7 +96,7 @@ describe('Telegram', function () {
method: 'POST',
json: true,
headers: {
"content-type": "application/json",
'content-type': 'application/json',
},
rejectUnhauthorized: false,
body: {update_id: 0, message: {text: 'test'}}
@@ -190,7 +192,7 @@ describe('Telegram', function () {
describe('#sendChatAction', function () {
it('should send a chat action', function (done) {
var bot = new Telegram(TOKEN);
var action = "typing";
var action = 'typing';
bot.sendChatAction(USERID, action).then(function (resp) {
resp.should.be.exactly(true);
done();