Personal Telegram developer console for GitHub
test(cp6): cover incident redaction and dedupe domain
davoodmehraban89 committed
Oct 5, 2026 at 06:19 UTC
c6276cf7047022dfd721245fa1109ef247bcb85c
1 file changed
+4
test/incidents.test.js
new
+4
@@ -0,0 +1,4 @@
1
+import test from 'node:test';import assert from 'node:assert/strict';import {incidentFingerprint,redactIncidentText,normalizeIncident} from '../src/core/incidents.js';
2
+test('CP6 fingerprint separates provider repo sha and kind',()=>{assert.notEqual(incidentFingerprint({provider:'github',repo:'a',sha:'1',kind:'ci'}),incidentFingerprint({provider:'github',repo:'a',sha:'2',kind:'ci'}));});
3
+test('CP6 redacts token/query material',()=>{const s=redactIncidentText('token=abc https://x.test/a?secret=bad');assert.doesNotMatch(s,/abc|bad/);});
4
+test('CP6 normalized incidents are open and source backed',()=>{const i=normalizeIncident({provider:'github',repo:'r',sha:'a'.repeat(40),kind:'ci',ciFailure:true,summary:'failed'});assert.equal(i.status,'open');assert.equal(i.severity,'high');assert.match(i.fingerprint,/github/);});