Add import template into tui. Fix tests that fail on macos. Fix some updates.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user