【发布时间】:2015-04-29 15:52:57
【问题描述】:
我正在尝试为我们设置一个测试,以验证被用户名和密码的基本身份验证阻止的路径的用户名和密码。
it('should receive a status code of 200 with login', function(done) {
request(url)
.get("/staging")
.expect(200)
.set('Authorization', 'Basic username:password')
.end(function(err, res) {
if (err) {
throw err;
}
done();
});
});
【问题讨论】:
标签: javascript node.js mocha.js basic-authentication supertest