fix(test): prevent config file from leaking kagi token into search test

The search token validation test only cleared KAGI_TOKEN from the
environment but still loaded the user config file, which could supply
the token and cause the test to pass incorrectly. Pass
--config=/nonexistent/path so loadConfig returns an empty object.

Also includes search command improvements: markdown/json format output
and --format flag.
This commit is contained in:
2026-05-02 19:29:53 -04:00
parent 8db4ed1370
commit eb1de23f4e
2 changed files with 29 additions and 3 deletions

View File

@@ -163,7 +163,7 @@ test(
test("search validates kagi token in provider", ["search", "errors"], () => {
const env = { ...process.env };
delete env.KAGI_TOKEN;
const result = runCli(["search", "example query"], { env });
const result = runCli(["search", "--config=/nonexistent/path", "example query"], { env });
const output = parseJson(result.stderr);
assert.notEqual(result.status, 0, result.stdout || result.stderr);