Check if test are running in CI and skip invoice if so

v1
Yago 9 years ago
parent e1f8fb25ec
commit 0bf148adb9
  1. 1
      package.json
  2. 7
      test/telegram.js

@ -57,6 +57,7 @@
"eslint-config-airbnb": "^6.2.0",
"eslint-plugin-mocha": "^4.8.0",
"is": "^3.1.0",
"is-ci": "^1.0.10",
"istanbul": "^1.1.0-alpha.1",
"jsdoc-to-markdown": "^2.0.1",
"mocha": "^3.2.0",

@ -7,17 +7,18 @@ const os = require('os');
const path = require('path');
const is = require('is');
const utils = require('./utils');
const isCI = require('is-ci');
// Allows self-signed certificates to be used in our tests
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
const TOKEN = process.env.TEST_TELEGRAM_TOKEN;
if (!TOKEN) {
if (!TOKEN)
throw new Error('Bot token not provided');
}
const PROVIDER_TOKEN = process.env.TEST_PROVIDER_TOKEN;
if (!PROVIDER_TOKEN) {
if (!PROVIDER_TOKEN && !isCI) { // If is not running in Travis / Appveyor
throw new Error('Provider token not supplied');
}
@ -1324,7 +1325,9 @@ describe('TelegramBot', function telegramSuite() {
utils.handleRatelimit(bot, 'sendInvoice', this);
});
it('should send an invoice', function test() {
if (isCI) {
this.skip(); // Skip test for now
}
const title = 'Demo product';
const description = 'our test product';
const payload = 'sku-p001';

Loading…
Cancel
Save