Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

ipWhitelist_spec.js 886B

123456789101112131415161718192021222324252627282930313233343536
  1. const fetch = require("node-fetch");
  2. const helpers = require("./global-setup");
  3. describe("ipWhitelist directive configuration", function () {
  4. describe("Set ipWhitelist without access", function () {
  5. beforeAll(function () {
  6. helpers.startApplication("tests/configs/noIpWhiteList.js");
  7. });
  8. afterAll(function () {
  9. helpers.stopApplication();
  10. });
  11. it("should return 403", function (done) {
  12. fetch("http://localhost:8080").then((res) => {
  13. expect(res.status).toBe(403);
  14. done();
  15. });
  16. });
  17. });
  18. describe("Set ipWhitelist []", function () {
  19. beforeAll(function () {
  20. helpers.startApplication("tests/configs/empty_ipWhiteList.js");
  21. });
  22. afterAll(function () {
  23. helpers.stopApplication();
  24. });
  25. it("should return 200", function (done) {
  26. fetch("http://localhost:8080").then((res) => {
  27. expect(res.status).toBe(200);
  28. done();
  29. });
  30. });
  31. });
  32. });