mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
31 lines
917 B
JavaScript
31 lines
917 B
JavaScript
const helpers = require("./global-setup");
|
|
|
|
describe("Vendors", () => {
|
|
beforeAll(() => {
|
|
helpers.startApplication("tests/configs/default.js");
|
|
});
|
|
afterAll(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
describe("Get list vendors", () => {
|
|
const vendors = require(__dirname + "/../../vendor/vendor.js");
|
|
|
|
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 helpers.fetch(urlVendor);
|
|
expect(res.status).toBe(200);
|
|
});
|
|
});
|
|
|
|
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 helpers.fetch(urlVendor);
|
|
expect(res.status).toBe(404);
|
|
});
|
|
});
|
|
});
|
|
});
|