mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Remove phin without introducing new dependencies (#755)
This commit is contained in:
1 parent
eafbc32d3d
commit
a9def876e8
7 files changed
+220
-297
No files matched your search
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user