execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
25 lines (24 loc) • 974 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const crypto_1 = require("./crypto");
describe('generateUniqueId', () => {
it('generates a unique hash for given inputs', () => {
const id1 = (0, crypto_1.generateHashId)('test', 123, { key: 'value' });
const id2 = (0, crypto_1.generateHashId)('test', 123, { key: 'value' });
expect(id1).toBe(id2);
});
it('generates different hashes for different inputs', () => {
const id1 = (0, crypto_1.generateHashId)('test1');
const id2 = (0, crypto_1.generateHashId)('test2');
expect(id1).not.toBe(id2);
});
it('handles empty input', () => {
const id1 = (0, crypto_1.generateHashId)();
const id2 = (0, crypto_1.generateHashId)();
expect(id1).toBe(id2);
});
it('creates a 64-character hash', () => {
const id = (0, crypto_1.generateHashId)('sample');
expect(id).toHaveLength(64);
});
});
;