oportunidades 8
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-14 08:25:30 +02:00
parent 287e991486
commit ba1c0340ea
9112 changed files with 2199795 additions and 856 deletions
@@ -0,0 +1,28 @@
var request = require('supertest');
var path = require('path');
var liveServer = require('..').start({
root: path.join(__dirname, "data"),
port: 0,
open: false,
htpasswd: path.join(__dirname, "data", "htpasswd-test")
});
describe('htpasswd tests', function() {
it('should respond with 401 since no password is given', function(done) {
request(liveServer)
.get('/')
.expect(401, done);
});
it('should respond with 401 since wrong password is given', function(done) {
request(liveServer)
.get('/')
.auth("test", "not-real-password")
.expect(401, done);
});
it('should respond with 200 since correct password is given', function(done) {
request(liveServer)
.get('/')
.auth("test", "test")
.expect(200, done);
});
});