⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
logs
/
View File Name :
UniqueKeyMaker.test.ts
import { UniqueKeyMaker } from './UniqueKeyMaker'; describe('UniqueKeyMaker', () => { const expectKeys = (testData: Array<[string, string]>) => { const k = new UniqueKeyMaker(); testData.forEach(([input, output]) => { expect(k.getKey(input)).toBe(output); }); // we also make a check that all the output-values are unique const outputs = testData.map(([i, o]) => o); const uniqueOutputLength = new Set(outputs).size; expect(uniqueOutputLength).toBe(outputs.length); }; it('should handle already unique keys', () => { expectKeys([ ['one', 'k_one'], ['two', 'k_two'], ['three', 'k_three'], ]); }); it('should handle duplicate keys', () => { expectKeys([ ['one', 'k_one'], ['one', 'i_2'], ['one', 'i_3'], ]); }); it('should handle a mix of unique and duplicate keys', () => { expectKeys([ ['one', 'k_one'], ['two', 'k_two'], ['one', 'i_3'], ['two', 'i_4'], ['three', 'k_three'], ]); }); });