Download __tests__/utils/get-language-from-path.test.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/utils/get-language-from-path.test.ts
- Command line
-
hf download hf://SaylorTwift/openhands/__tests__/utils/get-language-from-path.test.ts
-
curl -L -o get-language-from-path.test.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/utils/get-language-from-path.test.ts
1.05 kB
| import { describe, expect, it } from "vitest"; | |
| import { getLanguageFromPath } from "#/utils/get-language-from-path"; | |
| describe("getLanguageFromPath", () => { | |
| it.each([ | |
| ["index.js", "javascript"], | |
| ["component.JSX", "javascript"], | |
| ["types.ts", "typescript"], | |
| ["view.tsx", "typescript"], | |
| ["script.py", "python"], | |
| ["index.html", "html"], | |
| ["styles.css", "css"], | |
| ["package.json", "json"], | |
| ["README.md", "markdown"], | |
| ["workflow.yml", "yaml"], | |
| ["config.yaml", "yaml"], | |
| ["install.sh", "bash"], | |
| ["profile.bash", "bash"], | |
| ["container.dockerfile", "dockerfile"], | |
| ["main.rs", "rust"], | |
| ["main.go", "go"], | |
| ["Main.java", "java"], | |
| ["main.cpp", "cpp"], | |
| ["legacy.cc", "cpp"], | |
| ["native.cxx", "cpp"], | |
| ["native.c", "c"], | |
| ["task.rb", "ruby"], | |
| ["index.php", "php"], | |
| ["query.sql", "sql"], | |
| ["README", "text"], | |
| ["archive.unknown", "text"], | |
| ["", "text"], | |
| ])("maps %s to %s", (path, language) => { | |
| expect(getLanguageFromPath(path)).toBe(language); | |
| }); | |
| }); | |