Download packages/telemetry/test/normalize-remote.test.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/telemetry/test/normalize-remote.test.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/telemetry/test/normalize-remote.test.ts
-
curl -L -o normalize-remote.test.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/telemetry/test/normalize-remote.test.ts
1.2 kB
| import { describe, expect, it } from 'vitest'; | |
| import { normalizeRemote } from '../src/remote'; | |
| describe('normalizeRemote', () => { | |
| it.each([ | |
| ['git@github.com:user/repo.git', 'github.com/user/repo'], | |
| ['https://github.com/user/repo.git', 'github.com/user/repo'], | |
| ['https://github.com/user/repo', 'github.com/user/repo'], | |
| ['http://github.com/user/repo.git', 'github.com/user/repo'], | |
| ['https://user:token@github.com/org/repo.git', 'github.com/org/repo'], | |
| ['http://user@github.com/org/repo.git', 'github.com/org/repo'], | |
| ['https://user:pass:word@github.com/repo.git', 'github.com/repo'], | |
| ['git@host.com:path/to/repo.git', 'host.com/path/to/repo'], | |
| ['git@host.com:path/to/repo', 'host.com/path/to/repo'], | |
| ['https://github.com/org/team/repo.git', 'github.com/org/team/repo'], | |
| ['github.com/user/repo', 'github.com/user/repo'], | |
| ['github.com/user/repo.git', 'github.com/user/repo'], | |
| ['user@host.com:path/repo.git', 'host.com/path/repo'], | |
| ['', ''], | |
| [' ', ''], | |
| ['https://host.com:8443/path/repo.git', 'host.com/8443/path/repo'], | |
| ])('canonicalizes %s to %s', (url, expected) => { | |
| expect(normalizeRemote(url)).toBe(expected); | |
| }); | |
| }); | |