Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

htpasswd.js 755B

12345678910111213141516171819202122232425262728
  1. var request = require('supertest');
  2. var path = require('path');
  3. var liveServer = require('..').start({
  4. root: path.join(__dirname, "data"),
  5. port: 0,
  6. open: false,
  7. htpasswd: path.join(__dirname, "data", "htpasswd-test")
  8. });
  9. describe('htpasswd tests', function() {
  10. it('should respond with 401 since no password is given', function(done) {
  11. request(liveServer)
  12. .get('/')
  13. .expect(401, done);
  14. });
  15. it('should respond with 401 since wrong password is given', function(done) {
  16. request(liveServer)
  17. .get('/')
  18. .auth("test", "not-real-password")
  19. .expect(401, done);
  20. });
  21. it('should respond with 200 since correct password is given', function(done) {
  22. request(liveServer)
  23. .get('/')
  24. .auth("test", "test")
  25. .expect(200, done);
  26. });
  27. });