jest setup changes, increase setMaxListeners, disable console.log in tests/unit/global_vars

This commit is contained in:
Karsten Hassel
2021-06-12 20:03:20 +02:00
parent 298542b531
commit a5f7c946cc
5 changed files with 30 additions and 6 deletions

View File

@@ -27,19 +27,21 @@ describe("Vendors", function () {
describe("Get list vendors", function () {
const vendors = require(__dirname + "/../../vendor/vendor.js");
Object.keys(vendors).forEach((vendor) => {
it(`should return 200 HTTP code for vendor "${vendor}"`, function () {
it(`should return 200 HTTP code for vendor "${vendor}"`, function (done) {
const urlVendor = "http://localhost:8080/vendor/" + vendors[vendor];
fetch(urlVendor).then((res) => {
expect(res.status).toBe(200);
done();
});
});
});
Object.keys(vendors).forEach((vendor) => {
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function () {
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function (done) {
const urlVendor = "http://localhost:8080/" + vendors[vendor];
fetch(urlVendor).then((res) => {
expect(res.status).toBe(404);
done();
});
});
});