refactor(housekeeping): stabilize service contracts
This commit is contained in:
1 parent
67cb4b488d
commit
b7edbca043
10 files changed
+145
-28
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createCorrelationId } from "./correlation";
|
||||
|
||||
describe("createCorrelationId", () => {
|
||||
it("creates UUID-backed identifiers within the audit storage limit", () => {
|
||||
const correlationId = createCorrelationId();
|
||||
|
||||
expect(correlationId).toMatch(
|
||||
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,
|
||||
);
|
||||
expect(correlationId.length).toBeLessThanOrEqual(64);
|
||||
});
|
||||
|
||||
it("does not reuse an identifier for separate operations", () => {
|
||||
expect(createCorrelationId()).not.toBe(createCorrelationId());
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user