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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user