1
0
Fork 0
forked from svrjs/svrjs

Remove unnecessary mock implementations and update web root prefixes middleware test description

This commit is contained in:
Dorian Niemiec 2024-09-01 14:17:06 +02:00
parent 087eff332f
commit 5570042732

View file

@ -1,15 +1,11 @@
const middleware = require("../../src/middleware/webRootPostfixes.js");
const createRegex = require("../../src/utils/createRegex.js");
const ipMatch = require("../../src/utils/ipMatch.js");
const sanitizeURL = require("../../src/utils/urlSanitizer.js");
const parseURL = require("../../src/utils/urlParser.js");
jest.mock("../../src/utils/createRegex.js");
jest.mock("../../src/utils/ipMatch.js");
jest.mock("../../src/utils/urlSanitizer.js");
jest.mock("../../src/utils/urlParser.js");
describe("Web root postfixes middleware", () => {
describe("Web root prefixes middleware", () => {
let req, res, logFacilities, config, next;
beforeEach(() => {
@ -31,8 +27,6 @@ describe("Web root postfixes middleware", () => {
};
next = jest.fn();
createRegex.mockReturnValue(new RegExp());
ipMatch.mockReturnValue(true);
sanitizeURL.mockImplementation((url) => url);
parseURL.mockImplementation((url) => ({ pathname: url }));
});