Tests. Autocomplete. Few Fixes. Mocks for Electrum Service. Template-to-Json parser. Fix global paths. Use IO Dependency injection for logging from cli. Additional commands in CLI.
This commit is contained in:
28
tests/cli/integration/entry.test.ts
Normal file
28
tests/cli/integration/entry.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
|
||||
const runCli = (args: string[]) => {
|
||||
const tsxPath = path.resolve(process.cwd(), "node_modules/.bin/tsx");
|
||||
const cliPath = path.resolve(process.cwd(), "src/cli/index.ts");
|
||||
|
||||
return spawnSync(tsxPath, [cliPath, ...args], {
|
||||
encoding: "utf8",
|
||||
cwd: process.cwd(),
|
||||
});
|
||||
};
|
||||
|
||||
describe("cli entry boundary behavior", () => {
|
||||
test("returns non-zero for incomplete mnemonic invocation", () => {
|
||||
const result = runCli(["mnemonic"]);
|
||||
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stdout).toContain("Usage:");
|
||||
});
|
||||
|
||||
test("returns zero for mnemonic list invocation", () => {
|
||||
const result = runCli(["mnemonic", "list"]);
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user