diff --git a/package.json b/package.json index eb9a3fd..40989d5 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/telegram.js b/test/telegram.js index eb949cf..858e41a 100644 --- a/test/telegram.js +++ b/test/telegram.js @@ -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() { - this.skip(); // Skip test for now + if (isCI) { + this.skip(); // Skip test for now + } const title = 'Demo product'; const description = 'our test product'; const payload = 'sku-p001';