moved tests to fetch, run prettier

This commit is contained in:
Karsten Hassel
2021-03-02 21:26:25 +01:00
parent 92a35692f2
commit f09c54184a
7 changed files with 343 additions and 344 deletions

View File

@@ -1,5 +1,5 @@
const helpers = require("./global-setup");
const request = require("request");
const fetch = require("node-fetch");
const expect = require("chai").expect;
const describe = global.describe;
@@ -32,8 +32,8 @@ describe("Vendors", function () {
Object.keys(vendors).forEach((vendor) => {
it(`should return 200 HTTP code for vendor "${vendor}"`, function () {
var urlVendor = "http://localhost:8080/vendor/" + vendors[vendor];
request.get(urlVendor, function (err, res, body) {
expect(res.statusCode).to.equal(200);
fetch(urlVendor).then((res) => {
expect(res.status).to.equal(200);
});
});
});
@@ -41,8 +41,8 @@ describe("Vendors", function () {
Object.keys(vendors).forEach((vendor) => {
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function () {
var urlVendor = "http://localhost:8080/" + vendors[vendor];
request.get(urlVendor, function (err, res, body) {
expect(res.statusCode).to.equal(404);
fetch(urlVendor).then((res) => {
expect(res.status).to.equal(404);
});
});
});