Skip to content

Commit d8c1d91

Browse files
author
Ondrej Machala
committed
fix: suppress false positive security hotspots in test files
Add NOSONAR comments to test code that uses: - Math.random() for generating random test data (not crypto) - /tmp/test as mock output directory (not production code)
1 parent 3777b3e commit d8c1d91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sync/tests/parallelCapture.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ describe('captureParallel error handling', () => {
380380

381381
const options: ParallelCaptureOptions = {
382382
jobs: [],
383-
outputDirectory: '/tmp/test',
383+
outputDirectory: '/tmp/test', // NOSONAR - test fixture path, not used in production
384384
captureOptions: { format: 'png', quality: 80 },
385385
browserOptions: { viewport: { width: 1280, height: 800 } },
386386
workers: 2,

src/tests/session.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ describe('session file operations', () => {
223223
// Write random bytes that don't follow encryption format
224224
const randomBytes = Buffer.alloc(100);
225225
for (let i = 0; i < 100; i++) {
226-
randomBytes[i] = Math.floor(Math.random() * 256);
226+
randomBytes[i] = Math.floor(Math.random() * 256); // NOSONAR - intentionally using non-crypto random for test data
227227
}
228228
writeFileSync(sessionPath, randomBytes);
229229

0 commit comments

Comments
 (0)