Fix tests

This commit is contained in:
Sander Declerck 2026-03-10 12:58:22 +01:00
parent ceefaabe57
commit 1b32be6c58
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -7,7 +7,7 @@ const mockMitmConnect = mock.fn();
const mockTunnelRequest = mock.fn(); const mockTunnelRequest = mock.fn();
const mockUi = { writeVerbose: mock.fn() }; const mockUi = { writeVerbose: mock.fn() };
const mockGetCaCertPath = mock.fn(() => "/fake/cert/path"); const mockGetCaCertPath = mock.fn(() => "/fake/cert/path");
const mockGetHasSuppressedVersions = mock.fn(() => false); const mockModifyResponseEventEmitter = new EventEmitter();
/** @type {import("./interceptors/interceptorBuilder.js").Interceptor | undefined} */ /** @type {import("./interceptors/interceptorBuilder.js").Interceptor | undefined} */
let mockInterceptor; let mockInterceptor;
@ -30,7 +30,7 @@ mock.module("./interceptors/createInterceptorForEcoSystem.js", {
}, },
}); });
mock.module("./interceptors/npm/modifyNpmInfo.js", { mock.module("./interceptors/npm/modifyNpmInfo.js", {
namedExports: { getHasSuppressedVersions: mockGetHasSuppressedVersions }, namedExports: { modifyResponseEventEmitter: mockModifyResponseEventEmitter },
}); });
mock.module("./certUtils.js", { mock.module("./certUtils.js", {
namedExports: { getCaCertPath: mockGetCaCertPath }, namedExports: { getCaCertPath: mockGetCaCertPath },

View file

@ -1,4 +1,4 @@
import { EventEmitter } from "stream"; import { EventEmitter } from "events";
import { import {
getMinimumPackageAgeHours, getMinimumPackageAgeHours,
getNpmMinimumPackageAgeExclusions, getNpmMinimumPackageAgeExclusions,