Add import template into tui. Fix tests that fail on macos. Fix some updates.

This commit is contained in:
2026-05-29 18:16:00 +02:00
parent 85746c3306
commit 2f8dad7d8d
20 changed files with 1748 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
import { expect, test, describe, beforeEach, afterEach } from "vitest";
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
import { existsSync, mkdirSync, rmSync, writeFileSync, realpathSync } from "node:fs";
import { homedir, tmpdir } from "node:os";
import path from "node:path";
@@ -93,7 +93,13 @@ describe("paths utilities", () => {
try {
writeFileSync(path.join(tempDir, "mnemonic-cwd-test"), "test");
const resolved = resolveMnemonicFilePath("mnemonic-cwd-test");
expect(resolved).toBe(path.join(tempDir, "mnemonic-cwd-test"));
// Due to some weird MacOS behavior we need to use realpathSync to get the correct path
// Basically, tmpDir() returns a symlink, but moving to that path puts us at `/private/${tmpDir()}`
const expectedPath = realpathSync(path.join(tempDir, "mnemonic-cwd-test"));
// Compare to the expected path
expect(resolved).toBe(expectedPath);
} finally {
process.chdir(originalCwd);
}