it('correctly deletes the webhook if polling', function test() { const myBot = new TelegramBot(TOKEN, { polling: { autoStart: false, params: { timeout: 0 } }, }); utils.handleRatelimit(myBot, 'setWebHook', this); myBot.on('polling_error', (error) => { assert.ifError(error); }); return myBot.setWebHook(ip).then(() => { return myBot.startPolling(); }).then(() => { return myBot.stopPolling(); }); });
client.SET('AKEY', 'SOMEVALUE', function(err, reply) { assert.ifError(err); results['SET_TEST'] = true; });
client.set('akey', 'somevalue', function(err, reply) { assert.ifError(err); results['set_test'] = true; });
assert.ifError(err); console.log('Connected correctly to server'); assert.ifError(err); console.log('Inserted 1 document into the document collection'); collection0.drop(function(err, result) { assert.ifError(err); var collection = db.collection('documents'); assert.ifError(err); console.log('Inserted 3 documents into the document collection'); collection.createIndex({ a: 2 }, { unique: true, background: true, w: 1 }, function(err, indexName) { assert.ifError(err); collection.indexes(function(err, indexes) { assert.ifError(err); collection.dropIndexes(function(err, indexes) { assert.ifError(err); var res = collection.find(); assert.ifError(err); collection.count(function(err, count) { assert.ifError(err); if (err) { console.log(err); assert.ifError(err); console.log('Deleted 1 document from the document collection'); collection.deleteMany({ a: 2 }, function(err, result) { assert.ifError(err);
client.GET('AKEY', function(err, reply) { assert.ifError(err); results['GET_TEST'] = true; });
multiObject3.EXEC(function(err, reply) { assert.ifError(err); results['MULTI_TEST'] = true; });
client.get('akey', function(err, reply) { assert.ifError(err); results['get_test'] = true; });
batchObject1.exec(function(err, reply) { assert.ifError(err); results['batch_test'] = true; });
it('exit code 1 with warning for inverted same branch name', (done) => { const args = repoArgs.concat('-I', branchName); gitBranchIsCmd(args, (err, result) => { assert.ifError(err); assert.strictEqual(result.code, 1); assert(!result.stdout); assertMatch(result.stderr, branchRE); done(); }); });
it('exit code 0 silently for case-insensitive branch name', (done) => { const args = repoArgs.concat('-i', branchName.toUpperCase()); gitBranchIsCmd(args, (err, result) => { assert.ifError(err); assert.strictEqual(result.code, 0); assert(!result.stdout); assert(!result.stderr); done(); }); });
it('should throw if a target is not provided', () => { assert.throws(() => { zone.createAutoscaler(NAME, {}, assert.ifError); }, /Cannot create an autoscaler without a target\./); });
function create_tunnel(port) { const opt = { subdomain: 'foobar', host: 'http://local.dev:8080', }; localtunnel(port, opt, function(err, tunnel) { assert.ifError(err); console.log(tunnel.url); console.log('ready'); }); }
batchObject3.EXEC(function(err, reply) { assert.ifError(err); results['BATCH_TEST'] = true; });
multiObject1.exec(function(err, reply) { assert.ifError(err); results['multi_test'] = true; });