Enhances security checks and mocks fs module in tests
Updates security check patterns to include brackets for improved command injection prevention. Enhances test reliability by mocking Node's fs module to replace custom mock functions, aligning test behavior closer to actual usage scenarios and ensuring consistent outcomes. No specific issue reference.
This commit is contained in:
3 files changed
+61
-42
No files matched your search
@@ -154,7 +154,7 @@ describe('SecurityUtils', () => {
|
||||
|
||||
it('should return appropriate error for reserved names', () => {
|
||||
const error = SecurityUtils.getPathValidationError('CON');
|
||||
expect(error).toBe('Reserved system names are not allowed as folder names');
|
||||
expect(error).toBe('Reserved system names are not allowed in paths (found: CON)');
|
||||
});
|
||||
|
||||
it('should return generic error for unknown issues', () => {
|
||||
|
||||
Reference in new issue
Block a user