这里我正在尝试测试我的api但是在执行期间没有调用回调函数并且一直没有失败地返回。
const express = require('express')
const app = express();
const nconf = require('nconf');
const request = require('request');
var index = require('../index')
var querystring = require('querystring');
describe("Auth", function () {
console.log("Auth");
var form = {
"email":"a@a.com",
"password":"123456",
"name":"aleem",
"mobile":"12345678903",
"country":"india",
"state":"telangana",
"city":"hyderabad"
}
var formData = querystring.stringify(form);
// Creating account with existing user data
it ("Returns statusText false", function (done) {
var url = 'http://http://localhost:5000/api/auth/signup/';
var headers = {
'Content-Type' : 'application/x-www-form-urlencoded'
};
request.post({ url: url, form: formData, headers: headers }, function (e, r, body) {
// callback body
console.log(r.statusCode+'ka');
expect(r.statusText).toBe('false');
done() ;
});
});
});
在执行期间,未调用回调函数。