Wednesday 24 May 2017

How to Integrate Mocha and Loadtest for my Nodejs Server also chai expect is not working as expected

I have a node js server and i want to load test the server . I able to run the sload test on the server normally using the command loadtest -c 10 --rps 200 http://localhost:8200/status

I want to integrate mocha to do the load test for me how do we do that .

Also when using chai for my test case it always asserts true.

var expect  = require('chai').expect;
var request = require('request');
describe('Test', function() {
    describe('#Page', function () {
        it('Main page content', function () {
            request('http://localhost:8200/status', function (error, response, body) {
                console.log("Response" + JSON.stringify(response));
                expect(response.statusCode).to.equal(404); // this should return false but always returns true
            });
        });
    });
});

Please help i am using webstorm for my test pages



via Rahul

No comments:

Post a Comment