Download apps/vis/server/test/lib/config.test.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/server/test/lib/config.test.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vis/server/test/lib/config.test.ts
-
curl -L -o config.test.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/server/test/lib/config.test.ts
581 Bytes
| import { describe, it, expect } from 'vitest'; | |
| import { hostForUrl } from '../../src/config'; | |
| describe('hostForUrl', () => { | |
| it('brackets a bare IPv6 literal for use in a URL', () => { | |
| expect(hostForUrl('::1')).toBe('[::1]'); | |
| }); | |
| it('leaves an IPv4 literal unchanged', () => { | |
| expect(hostForUrl('127.0.0.1')).toBe('127.0.0.1'); | |
| }); | |
| it('leaves a hostname unchanged', () => { | |
| expect(hostForUrl('localhost')).toBe('localhost'); | |
| }); | |
| it('leaves an already-bracketed IPv6 literal unchanged', () => { | |
| expect(hostForUrl('[::1]')).toBe('[::1]'); | |
| }); | |
| }); | |