mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-08-29 18:31:33 +00:00
fix: preserve architecture in unpacked ASAR path (#1094)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { createRequire } from "node:module";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const { getUnpackedAppRoot } =
|
||||
require("../../../../electron/backend-paths.cjs") as {
|
||||
getUnpackedAppRoot: (appRoot: string) => string;
|
||||
};
|
||||
|
||||
describe("getUnpackedAppRoot", () => {
|
||||
it.each([
|
||||
[
|
||||
"/Applications/Termix.app/Contents/Resources/app.asar",
|
||||
"/Applications/Termix.app/Contents/Resources/app.asar.unpacked",
|
||||
],
|
||||
[
|
||||
"/Applications/Termix.app/Contents/Resources/app-arm64.asar",
|
||||
"/Applications/Termix.app/Contents/Resources/app-arm64.asar.unpacked",
|
||||
],
|
||||
[
|
||||
"/Applications/Termix.app/Contents/Resources/app-x64.asar",
|
||||
"/Applications/Termix.app/Contents/Resources/app-x64.asar.unpacked",
|
||||
],
|
||||
])("maps %s to its matching unpacked directory", (appRoot, expected) => {
|
||||
expect(getUnpackedAppRoot(appRoot)).toBe(expected);
|
||||
});
|
||||
|
||||
it("does not append the suffix twice", () => {
|
||||
const appRoot =
|
||||
"/Applications/Termix.app/Contents/Resources/app-arm64.asar.unpacked";
|
||||
expect(getUnpackedAppRoot(appRoot)).toBe(appRoot);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user