-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuiltin.test.ts
More file actions
27 lines (21 loc) · 919 Bytes
/
Copy pathbuiltin.test.ts
File metadata and controls
27 lines (21 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { describe, expect, it } from "bun:test";
import { BUILTIN_ADAPTERS, getAdapterForExtension } from "./builtin";
describe("getAdapterForExtension", () => {
it("resolves TS/JS extensions to builtin.ts-js", () => {
expect(getAdapterForExtension(".ts")?.id).toBe("builtin.ts-js");
expect(getAdapterForExtension(".TS")?.id).toBe("builtin.ts-js");
expect(getAdapterForExtension(".tsx")?.id).toBe("builtin.ts-js");
});
it("resolves .css to builtin.css", () => {
expect(getAdapterForExtension(".css")?.id).toBe("builtin.css");
});
it("resolves .md to builtin.text", () => {
expect(getAdapterForExtension(".md")?.id).toBe("builtin.text");
});
it("returns undefined for unknown extensions", () => {
expect(getAdapterForExtension(".unknown")).toBeUndefined();
});
it("lists built-in adapters", () => {
expect(BUILTIN_ADAPTERS.length).toBeGreaterThanOrEqual(3);
});
});