Remove phin without introducing new dependencies (#755)

This commit is contained in:
Cooldude2606 authored and GitHub committed 2025-04-15 19:09:25 +01:00
1 parent eafbc32d3d
commit a9def876e8
7 files changed
+220 -297

No files matched your search

+4 -7
View File
@@ -7,15 +7,8 @@ const JSZip = require("jszip"); // Added for creating mock zips
// Capture native fetch before any potential mocks are applied
const nativeFetch = global.fetch;
// Removed logger mocking setup
const { ModStore, ModInfo } = require("@clusterio/lib"); // Adjust path based on compiled output
// Mock fetch function
global.fetch = async (url, options) => {
throw new Error(`fetch mock not implemented for ${url}`);
};
const MODS_DIR = path.join("temp", "test", "mod_store", "mods");
const CACHE_FILE = path.join(MODS_DIR, "mod-info-cache.json");
@@ -49,6 +42,10 @@ describe("lib/ModStore", function () {
await fs.ensureDir(MODS_DIR);
});
after(function() {
global.fetch = nativeFetch;
});
beforeEach(function () {
// Reset mocks before each test
global.fetch = async (url, options) => {