function makeRequest(url, data, cb) {
    var Jet = require('./../../core/JetServer.js');
    var request = require('request');
    var testDomain = 'http://localhost:3001';
    var settings = url;

    /// Handle arguments
    if ('function' === typeof data) {
        cb = data; data = undefined;
    }

    if ('string' === typeof settings) {
        settings = testDomain + settings;
    } else if ('object' === typeof settings) {
        settings.uri = testDomain + settings.uri;
        if (!settings.method) {
            settings.method = 'GET';
        }
    }

    var JetApp = new Jet({jetDir: process.cwd(), appDir: process.cwd() + '/test/app', port: 3001});
    JetApp.addEventListener('onServerStart', function() {
        request(settings, function(err, res, body) {
            JetApp.shutdown(function() {
                cb(err, res, body);
            });
        });
    });
    return JetApp.run();
}
/**
 * Method for making requests. Initializes instance of the app,
 * makes the request and returns the result, and then it closes
 * down the instance. Each request, starts new instance.
 * @param url
 * @param data
 * @param cb
 */
Method for making requests. Initializes instance of the app,
makes the request and returns the result, and then it closes
down the instance. Each request, starts new instance.
Method for making requests . Initializes instance of the app makes the request and returns the result and then it closes down the instance . Each request starts new instance .
function makeRequest(url, data, cb) {
    var Jet = require('./../../core/JetServer.js');
    var request = require('request');
    var testDomain = 'http://localhost:3001';
    var settings = url;
    if ('function' === typeof data) {
        cb = data; data = undefined;
    }
    if ('string' === typeof settings) {
        settings = testDomain + settings;
    } else if ('object' === typeof settings) {
        settings.uri = testDomain + settings.uri;
        if (!settings.method) {
            settings.method = 'GET';
        }
    }
    var JetApp = new Jet({jetDir: process.cwd(), appDir: process.cwd() + '/test/app', port: 3001});
    JetApp.addEventListener('onServerStart', function() {
        request(settings, function(err, res, body) {
            JetApp.shutdown(function() {
                cb(err, res, body);
            });
        });
    });
    return JetApp.run();
}
function makeRequest ( url , data , cb ) { var Jet = require ( './../../core/JetServer.js' ) ; var request = require ( 'request' ) ; var testDomain = 'http://localhost:3001' ; var settings = url ; if ( 'function' === typeof data ) { cb = data ; data = undefined ; } if ( 'string' === typeof settings ) { settings = testDomain + settings ; } else if ( 'object' === typeof settings ) { settings . uri = testDomain + settings . uri ; if ( ! settings . method ) { settings . method = 'GET' ; } } var JetApp = new Jet ( { jetDir : process . cwd ( ) , appDir : process . cwd ( ) + '/test/app' , port : 3001 } ) ; JetApp . addEventListener ( 'onServerStart' , function ( ) { request ( settings , function ( err , res , body ) { JetApp . shutdown ( function ( ) { cb ( err , res , body ) ; } ) ; } ) ; } ) ; return JetApp . run ( ) ; }
Method for making requests.
Method for making requests .
/// Handle arguments