Spaces:
Running
Running
Download src/lib/utils/tree/isMessageId.spec.ts from huggingchat/chat-ui: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/huggingchat/chat-ui/resolve/refs%2Fpr%2F511/src/lib/utils/tree/isMessageId.spec.ts
- Command line
-
hf download hf://spaces/huggingchat/chat-ui@refs/pr/511/src/lib/utils/tree/isMessageId.spec.ts
-
curl -L -o isMessageId.spec.ts https://huggingface.co/spaces/huggingchat/chat-ui/resolve/refs%2Fpr%2F511/src/lib/utils/tree/isMessageId.spec.ts
469 Bytes
| import { describe, expect, it } from "vitest"; | |
| import { isMessageId } from "./isMessageId"; | |
| import { v4 } from "uuid"; | |
| describe("isMessageId", () => { | |
| it("should return true for a valid message id", () => { | |
| expect(isMessageId(v4())).toBe(true); | |
| }); | |
| it("should return false for an invalid message id", () => { | |
| expect(isMessageId("1-2-3-4")).toBe(false); | |
| }); | |
| it("should return false for an empty string", () => { | |
| expect(isMessageId("")).toBe(false); | |
| }); | |
| }); | |