Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
SERVER.listen(PORT, function () {
client = restifyClients.createStringClient('http://' + HOST + ':' +
PORT);
_.forEach(config.routes, function (route, name) {
_.forEach(route, function (source, method) {
if (method === 'delete') {
/* eslint-disable no-param-reassign */
method = 'del';
/* eslint-enable no-function-reassign */
}
if (method === 'options') {
/* eslint-disable no-param-reassign */
method = 'opts';
/* eslint-enable no-function-reassign */
}
barrier.start(method + name);
client[method]('/' + name, function (err, req, res, obj) {
// jscs:disable maximumLineLength
'use strict';
var chai = require('chai');
var _ = require('lodash');
var restify = require('restify-clients');
var demoServer = require('../example/demo');
var assert = chai.assert;
var client = restify.createJsonClient({
url: 'http://localhost:3003'
});
var stringClient = restify.createStringClient({
url: 'http://localhost:3003'
});
// star tests
describe('Integration tests using the demo app', function() {
before(function(done) {
demoServer.listen(3003, done);
});
after(function(done) {
client.close();
stringClient.close();
demoServer.close(done);
});
describe('Simple handler chains', function() {
HOT_RELOAD_TMP_DIR + '/fooGet.js', function (err3) {
assert.ifError(err3);
var client = restifyClients.createStringClient('http://'
+ HOST + ':' + PORT);
client.get('/foo', function (err4, req, res, obj) {
client.close();
assert.ifError(err4);
assert.equal('yes', res.headers.reload);
return done();
});
});
});