Skip to content

Commit 51da036

Browse files
Mossakaclaude
andcommitted
test: add unmountSslTmpfs tests to restore function coverage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d9c1ce6 commit 51da036

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/ssl-bump.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import * as os from 'os';
44
import execa from 'execa';
5-
import { parseUrlPatterns, generateSessionCa, initSslDb, isOpenSslAvailable, secureWipeFile, cleanupSslKeyMaterial, chownRecursive } from './ssl-bump';
5+
import { parseUrlPatterns, generateSessionCa, initSslDb, isOpenSslAvailable, secureWipeFile, cleanupSslKeyMaterial, chownRecursive, unmountSslTmpfs } from './ssl-bump';
66

77
// Pattern constant for the safer URL character class (matches the implementation)
88
const URL_CHAR_PATTERN = '[^\\s]*';
@@ -455,4 +455,17 @@ describe('SSL Bump', () => {
455455
expect(() => cleanupSslKeyMaterial(tempDir)).not.toThrow();
456456
});
457457
});
458+
459+
describe('unmountSslTmpfs', () => {
460+
it('should call umount on the ssl directory', async () => {
461+
mockExeca.mockResolvedValueOnce({ stdout: '', stderr: '' });
462+
await unmountSslTmpfs('/tmp/test-ssl');
463+
expect(mockExeca).toHaveBeenCalledWith('umount', ['/tmp/test-ssl']);
464+
});
465+
466+
it('should handle umount failure gracefully', async () => {
467+
mockExeca.mockRejectedValueOnce(new Error('not mounted'));
468+
await expect(unmountSslTmpfs('/tmp/test-ssl')).resolves.not.toThrow();
469+
});
470+
});
458471
});

0 commit comments

Comments
 (0)