mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
29 lines
823 B
TypeScript
29 lines
823 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { artifactKind } from "./artifact.js"
|
|
|
|
describe("artifactKind", () => {
|
|
test.each([
|
|
["shot.PNG", "image"],
|
|
["logo.svg", "svg"],
|
|
["song.mp3", "audio"],
|
|
["demo.mp4", "video"],
|
|
["clip.webm", "video"],
|
|
["paper.pdf", "pdf"],
|
|
["out/index.html", "html"],
|
|
["README.md", "markdown"],
|
|
["flow.mmd", "mermaid"],
|
|
["data.csv", "table"],
|
|
["data.tsv", "table"],
|
|
["Inter.woff2", "font"],
|
|
["report.docx", "document"],
|
|
["budget.XLSX", "spreadsheet"],
|
|
["deck.pptx", "presentation"],
|
|
["legacy.doc", "text"],
|
|
["src/app.ts", "text"],
|
|
["Makefile", "text"],
|
|
[".env", "text"],
|
|
["archive.tar.gz", "text"],
|
|
] as const)("classifies %s as %s", (path, kind) => {
|
|
expect(artifactKind(path)).toBe(kind)
|
|
})
|
|
})
|