forked from svrjs/svrjs
Remove unnecessary mock implementations and update web root prefixes middleware test description
This commit is contained in:
parent
087eff332f
commit
5570042732
1 changed files with 1 additions and 7 deletions
|
@ -1,15 +1,11 @@
|
||||||
const middleware = require("../../src/middleware/webRootPostfixes.js");
|
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 sanitizeURL = require("../../src/utils/urlSanitizer.js");
|
||||||
const parseURL = require("../../src/utils/urlParser.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/urlSanitizer.js");
|
||||||
jest.mock("../../src/utils/urlParser.js");
|
jest.mock("../../src/utils/urlParser.js");
|
||||||
|
|
||||||
describe("Web root postfixes middleware", () => {
|
describe("Web root prefixes middleware", () => {
|
||||||
let req, res, logFacilities, config, next;
|
let req, res, logFacilities, config, next;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -31,8 +27,6 @@ describe("Web root postfixes middleware", () => {
|
||||||
};
|
};
|
||||||
next = jest.fn();
|
next = jest.fn();
|
||||||
|
|
||||||
createRegex.mockReturnValue(new RegExp());
|
|
||||||
ipMatch.mockReturnValue(true);
|
|
||||||
sanitizeURL.mockImplementation((url) => url);
|
sanitizeURL.mockImplementation((url) => url);
|
||||||
parseURL.mockImplementation((url) => ({ pathname: url }));
|
parseURL.mockImplementation((url) => ({ pathname: url }));
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue