mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
pkg: Fix bug #275
Bug: Node.js v4 does not support the ES6 syntax fully, thus we get the error: Block scoped declarations (let, const, function,class) not yet supported outside strict mode Fix: * Load transpiled code * Deprecate support for Node.js v4.x References: * Bug report: https://github.com/yagop/node-telegram-bot-api/issues/275 * PR: https://github.com/yagop/node-telegram-bot-api/pull/280 * Reported-by: @crazyabdul * PR-by: @crazyabdul
This commit is contained in:
@@ -44,12 +44,13 @@ before(function beforeAll() {
|
||||
|
||||
|
||||
describe('module.exports', function moduleExportsSuite() {
|
||||
it('is loaded from src/ if NOT on Node.js 0.12', function test() {
|
||||
if (process.versions.node.split('.')[0] === '0') this.skip(); // skip on Node.js v0.12
|
||||
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
|
||||
it('is loaded from src/ on Node.js v5+', function test() {
|
||||
if (nodeVersion <= 4) this.skip(); // skip on Node.js v4 and below
|
||||
assert.equal(TelegramBot, require('../src/telegram'));
|
||||
});
|
||||
it('is loaded from lib/ if on Node.js 0.12', function test() {
|
||||
if (process.versions.node.split('.')[0] !== '0') this.skip(); // skip on newer versions
|
||||
it('is loaded from lib/ on Node.js v4 and below', function test() {
|
||||
if (nodeVersion > 4) this.skip(); // skip on newer versions
|
||||
assert.equal(TelegramBot, require('../lib/telegram'));
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user