mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 09:29:38 +02:00
fix(ts): close effect native review blockers
This commit is contained in:
parent
b6759e75df
commit
a26463afc1
13 changed files with 438 additions and 528 deletions
|
|
@ -2,6 +2,25 @@ import { describe, expect, it } from "vitest";
|
|||
import { guessMimeType } from "../commands/library.js";
|
||||
|
||||
describe("library CLI helpers", () => {
|
||||
it("keeps library load -t assigned to title while token remains long-only", () => {
|
||||
const result = Bun.spawnSync({
|
||||
cmd: ["bun", "src/index.ts", "library", "load", "--help"],
|
||||
cwd: new URL("../../", import.meta.url).pathname,
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
});
|
||||
|
||||
const stdout = result.stdout.toString();
|
||||
const stderr = result.stderr.toString();
|
||||
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(stderr).toBe("");
|
||||
expect(stdout).toContain("--title");
|
||||
expect(stdout).toContain("-t");
|
||||
expect(stdout).toContain("--token");
|
||||
expect(stdout).not.toContain("-t, --token");
|
||||
});
|
||||
|
||||
it("detects known MIME types through the Match-backed extension mapper", () => {
|
||||
expect(guessMimeType("paper.pdf")).toBe("application/pdf");
|
||||
expect(guessMimeType("notes.TXT")).toBe("text/plain");
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ export const rootCommand = Command.make("tg").pipe(
|
|||
Flag.withDefault("cli"),
|
||||
),
|
||||
token: Flag.string("token").pipe(
|
||||
Flag.withAlias("t"),
|
||||
Flag.withDescription("Authentication token"),
|
||||
Flag.optional,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue