mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
moved tests to fetch, run prettier
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user