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,6 +1,6 @@
|
||||
// @vitest-environment node
|
||||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getRuntimePath } from "@/lib/utils/runtime-path";
|
||||
|
||||
const { existsSyncMock, settingGetMock } = vi.hoisted(() => ({
|
||||
existsSyncMock: vi.fn(),
|
||||
@@ -19,9 +19,9 @@ vi.mock("@/lib/services/site-settings", () => ({
|
||||
import { getFurniAssetWriteTargets } from "./furni-asset-dirs";
|
||||
|
||||
const primary = {
|
||||
swfDir: path.join("test-assets", "primary", "swf"),
|
||||
iconDir: path.join("test-assets", "primary", "icons"),
|
||||
nitroDir: path.join("test-assets", "primary", "furniture"),
|
||||
swfDir: getRuntimePath("test-assets", "primary", "swf"),
|
||||
iconDir: getRuntimePath("test-assets", "primary", "icons"),
|
||||
nitroDir: getRuntimePath("test-assets", "primary", "furniture"),
|
||||
};
|
||||
|
||||
function configureSettings(values: Record<string, string>): void {
|
||||
@@ -38,7 +38,7 @@ describe("getFurniAssetWriteTargets", () => {
|
||||
});
|
||||
|
||||
it("maps a configured production Gamedata root to the directories served by Nitro", async () => {
|
||||
const gamedataRoot = path.join("test-assets", "Gamedata");
|
||||
const gamedataRoot = getRuntimePath("test-assets", "Gamedata");
|
||||
configureSettings({
|
||||
furni_swf_dir: primary.swfDir,
|
||||
furni_icon_dir: primary.iconDir,
|
||||
@@ -51,8 +51,8 @@ describe("getFurniAssetWriteTargets", () => {
|
||||
|
||||
expect(targets.mirrorDirs).toContainEqual({
|
||||
swfDir: primary.swfDir,
|
||||
iconDir: path.join(gamedataRoot, "icons"),
|
||||
nitroDir: path.join(gamedataRoot, "bundled", "furniture"),
|
||||
iconDir: getRuntimePath(gamedataRoot, "icons"),
|
||||
nitroDir: getRuntimePath(gamedataRoot, "bundled", "furniture"),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -71,11 +71,11 @@ describe("getFurniAssetWriteTargets", () => {
|
||||
});
|
||||
|
||||
it("does not duplicate a Gamedata layout already used as the primary target", async () => {
|
||||
const gamedataRoot = path.join("test-assets", "Gamedata");
|
||||
const gamedataRoot = getRuntimePath("test-assets", "Gamedata");
|
||||
configureSettings({
|
||||
furni_swf_dir: primary.swfDir,
|
||||
furni_icon_dir: path.join(gamedataRoot, "icons"),
|
||||
furni_nitro_dir: path.join(gamedataRoot, "bundled", "furniture"),
|
||||
furni_icon_dir: getRuntimePath(gamedataRoot, "icons"),
|
||||
furni_nitro_dir: getRuntimePath(gamedataRoot, "bundled", "furniture"),
|
||||
nitro_files_root: "",
|
||||
gamedata_root: gamedataRoot,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user