apps/gateway/src/tests/workspace.test.ts
Metadata
- Purpose: Source artifact in the anchor-msp system.
- Domain:
applications - Language:
ts - Bytes: 600
- Lines: 21
- Content hash (short):
d17fda14 - Source (start): apps/gateway/src/tests/workspace.test.ts:1
- Source (end): apps/gateway/src/tests/workspace.test.ts:21
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import { test } from "node:test";
import assert from "node:assert/strict";
import { getWorkspaceIdFromHeaders } from "../utils/workspace.js";
test("getWorkspaceIdFromHeaders extracts uuid from default header", () => {
const headers = {
"x-workspace-id": "00000000-0000-4000-8000-000000000001"
};
const value = getWorkspaceIdFromHeaders(headers);
assert.equal(value, headers["x-workspace-id"]);
});
test("getWorkspaceIdFromHeaders rejects invalid uuid", () => {
const headers = {
"x-workspace-id": "not-a-uuid"
};
assert.throws(() => getWorkspaceIdFromHeaders(headers));
});