Skip to content

Commit ce93ac8

Browse files
author
Eric Wheeler
committed
test: verify dist WASM files exist
Add test to verify presence of all required WASM files in dist directory: - tiktoken_bg.wasm for tokenization - tree-sitter.wasm core parser - Language-specific tree-sitter WASM files for syntax highlighting Signed-off-by: Eric Wheeler <[email protected]>
1 parent 664d5b1 commit ce93ac8

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/__tests__/dist_assets.test.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import * as fs from "fs"
2+
import * as path from "path"
3+
4+
describe("dist assets", () => {
5+
const distPath = path.join(__dirname, "../../dist")
6+
7+
describe("tiktoken", () => {
8+
it("should have tiktoken wasm file", () => {
9+
expect(fs.existsSync(path.join(distPath, "tiktoken_bg.wasm"))).toBe(true)
10+
})
11+
})
12+
13+
describe("tree-sitter", () => {
14+
const treeSitterFiles = [
15+
"tree-sitter-bash.wasm",
16+
"tree-sitter-cpp.wasm",
17+
"tree-sitter-c_sharp.wasm",
18+
"tree-sitter-css.wasm",
19+
"tree-sitter-c.wasm",
20+
"tree-sitter-elisp.wasm",
21+
"tree-sitter-elixir.wasm",
22+
"tree-sitter-elm.wasm",
23+
"tree-sitter-embedded_template.wasm",
24+
"tree-sitter-go.wasm",
25+
"tree-sitter-html.wasm",
26+
"tree-sitter-javascript.wasm",
27+
"tree-sitter-java.wasm",
28+
"tree-sitter-json.wasm",
29+
"tree-sitter-kotlin.wasm",
30+
"tree-sitter-lua.wasm",
31+
"tree-sitter-objc.wasm",
32+
"tree-sitter-ocaml.wasm",
33+
"tree-sitter-php.wasm",
34+
"tree-sitter-python.wasm",
35+
"tree-sitter-ql.wasm",
36+
"tree-sitter-rescript.wasm",
37+
"tree-sitter-ruby.wasm",
38+
"tree-sitter-rust.wasm",
39+
"tree-sitter-scala.wasm",
40+
"tree-sitter-solidity.wasm",
41+
"tree-sitter-swift.wasm",
42+
"tree-sitter-systemrdl.wasm",
43+
"tree-sitter-tlaplus.wasm",
44+
"tree-sitter-toml.wasm",
45+
"tree-sitter-tsx.wasm",
46+
"tree-sitter-typescript.wasm",
47+
"tree-sitter-vue.wasm",
48+
"tree-sitter.wasm",
49+
"tree-sitter-yaml.wasm",
50+
"tree-sitter-zig.wasm",
51+
]
52+
53+
test.each(treeSitterFiles)("should have %s file", (filename) => {
54+
expect(fs.existsSync(path.join(distPath, filename))).toBe(true)
55+
})
56+
})
57+
})

0 commit comments

Comments
 (0)