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.

https.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var request = require('supertest');
  2. var path = require('path');
  3. // accept self-signed certificates
  4. process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
  5. function tests(liveServer) {
  6. it('should reply with a correct index file', function(done) {
  7. request(liveServer)
  8. .get('/index.html')
  9. .expect('Content-Type', 'text/html; charset=UTF-8')
  10. .expect(/Hello world/i)
  11. .expect(200, done);
  12. });
  13. it('should support head request', function(done) {
  14. request(liveServer)
  15. .head('/index.html')
  16. .expect('Content-Type', 'text/html; charset=UTF-8')
  17. .expect(200, done);
  18. });
  19. }
  20. describe('https tests with external module', function() {
  21. var opts = {
  22. root: path.join(__dirname, 'data'),
  23. port: 0,
  24. open: false,
  25. https: path.join(__dirname, 'conf/https.conf.js')
  26. };
  27. var liveServer = require("..").start(opts);
  28. tests(liveServer);
  29. after(function () {
  30. liveServer.close()
  31. });
  32. });
  33. describe('https tests with object', function() {
  34. var opts = {
  35. root: path.join(__dirname, 'data'),
  36. port: 0,
  37. open: false,
  38. https: require(path.join(__dirname, 'conf/https.conf.js'))
  39. };
  40. var liveServer = require("..").start(opts);
  41. tests(liveServer);
  42. after(function () {
  43. liveServer.close()
  44. });
  45. });