MagicMirror/tests/e2e/vendor_spec.js

31 lines
921 B
JavaScript
Raw Normal View History

const helpers = require("./helpers/global-setup");
describe("Vendors", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/default.js");
});
afterAll(async () => {
await helpers.stopApplication();
});
describe("Get list vendors", () => {
const vendors = require(`${__dirname}/../../vendor/vendor.js`);
2021-06-30 15:22:24 +02:00
Object.keys(vendors).forEach((vendor) => {
it(`should return 200 HTTP code for vendor "${vendor}"`, async () => {
const urlVendor = `http://localhost:8080/vendor/${vendors[vendor]}`;
const res = await fetch(urlVendor);
expect(res.status).toBe(200);
});
});
2017-04-18 23:44:50 -03:00
Object.keys(vendors).forEach((vendor) => {
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, async () => {
const urlVendor = `http://localhost:8080/${vendors[vendor]}`;
const res = await fetch(urlVendor);
expect(res.status).toBe(404);
2017-04-18 23:44:50 -03:00
});
});
});
});