Fix Turbopack module resolution for lzma and restore path imports
This commit is contained in:
1 parent
a5044c80d7
commit
e06596391e
35 files changed
+392
-333
No files matched your search
@@ -1,8 +1,8 @@
|
||||
// @vitest-environment node
|
||||
import { promises as fs } from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getRuntimePath } from "@/lib/utils/runtime-path";
|
||||
|
||||
const {
|
||||
appendFurniEntryMock,
|
||||
@@ -96,15 +96,15 @@ describe("uploadSingleFurni live asset mirrors", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
__resetUploadItemsBaseAllocatorForTests();
|
||||
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "upload-furni-"));
|
||||
assetTargets.swfDir = path.join(tempDir, "cms", "swf");
|
||||
assetTargets.iconDir = path.join(tempDir, "cms", "icons");
|
||||
assetTargets.nitroDir = path.join(tempDir, "cms", "furniture");
|
||||
tempDir = await fs.mkdtemp(getRuntimePath(os.tmpdir(), "upload-furni-"));
|
||||
assetTargets.swfDir = getRuntimePath(tempDir, "cms", "swf");
|
||||
assetTargets.iconDir = getRuntimePath(tempDir, "cms", "icons");
|
||||
assetTargets.nitroDir = getRuntimePath(tempDir, "cms", "furniture");
|
||||
assetTargets.mirrorDirs = [
|
||||
{
|
||||
swfDir: assetTargets.swfDir,
|
||||
iconDir: path.join(tempDir, "Gamedata", "icons"),
|
||||
nitroDir: path.join(tempDir, "Gamedata", "bundled", "furniture"),
|
||||
iconDir: getRuntimePath(tempDir, "Gamedata", "icons"),
|
||||
nitroDir: getRuntimePath(tempDir, "Gamedata", "bundled", "furniture"),
|
||||
},
|
||||
];
|
||||
dbExecuteMock.mockReset();
|
||||
@@ -135,12 +135,12 @@ describe("uploadSingleFurni live asset mirrors", () => {
|
||||
expect(result.ok).toBe(true);
|
||||
await expect(
|
||||
fs.readFile(
|
||||
path.join(assetTargets.mirrorDirs[0].nitroDir, "chair.nitro"),
|
||||
getRuntimePath(assetTargets.mirrorDirs[0].nitroDir, "chair.nitro"),
|
||||
),
|
||||
).resolves.toEqual(nitroBuffer);
|
||||
await expect(
|
||||
fs.readFile(
|
||||
path.join(assetTargets.mirrorDirs[0].iconDir, "chair_icon.png"),
|
||||
getRuntimePath(assetTargets.mirrorDirs[0].iconDir, "chair_icon.png"),
|
||||
),
|
||||
).resolves.toEqual(iconBuffer);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user