我正在学习使用 mocha 和 chai 为节点应用程序编写测试用例,我已经编写了以下测试用例
let chai = require('chai');
let chaiHttp = require('chai-http');
const should = chai.should;
const expect = chai.expect;
const server = "http:\\localhost:3000"
chai.use(chaiHttp);
describe('Create Login and Register', () => {
it('should login using credentials', () => {
chai.request(server)
.get('/register')
.send()
.then((res: any) => {
res.should.have.status(200);
done();
}).catch((err: any) => { done(err) })
})
})
我是否需要添加一些类型才能使其正常工作我缺少什么,我尝试再次安装 chai-http 但仍然是同样的问题
