Hi ,
I am writing test cases for node js. Please tell me how can I send a post request having parameters.
I am writing in this way but it is showing data undefined.
var request =require('request');
describe('afterEach Timeout', function(){
afterEach(function(done) {
setTimeout(done, 1000);
}, 100);
it("should respond with hello world", function(done) {
var body=new Object( );
body.email="
s...@sa.com";
body.password="pass";
request.post("
http://localhost:3000/loginAuth",body, function(error, response, body){
expect(response).not.toBeNull();
console.log(response);
done();
});
});
});
Thanks