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.

vendor_spec.js 996B

1234567891011121314151617181920212223242526272829303132333435
  1. const fetch = require("node-fetch");
  2. const helpers = require("./global-setup");
  3. describe("Vendors", function () {
  4. beforeAll(function () {
  5. helpers.startApplication("tests/configs/default.js");
  6. });
  7. afterAll(function () {
  8. helpers.stopApplication();
  9. });
  10. describe("Get list vendors", function () {
  11. const vendors = require(__dirname + "/../../vendor/vendor.js");
  12. Object.keys(vendors).forEach((vendor) => {
  13. it(`should return 200 HTTP code for vendor "${vendor}"`, function (done) {
  14. const urlVendor = "http://localhost:8080/vendor/" + vendors[vendor];
  15. fetch(urlVendor).then((res) => {
  16. expect(res.status).toBe(200);
  17. done();
  18. });
  19. });
  20. });
  21. Object.keys(vendors).forEach((vendor) => {
  22. it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function (done) {
  23. const urlVendor = "http://localhost:8080/" + vendors[vendor];
  24. fetch(urlVendor).then((res) => {
  25. expect(res.status).toBe(404);
  26. done();
  27. });
  28. });
  29. });
  30. });
  31. });