/**
* Security testing helpers
*/
import { vi } from 'vitest';
/**
* Mock security vulnerability scanner
*/
export function createMockVulnerabilityScanner() {
return {
scan: vi.fn().mockResolvedValue({
vulnerabilities: [],
severity: 'low',
timestamp: new Date(),
}),
scanFile: vi.fn().mockResolvedValue({
vulnerabilities: [],
severity: 'low',
}),
};
}
/**
* Create test data for security testing
*/
export function createSecurityTestData() {
return {
// SQL injection test cases
sqlInjectionPayloads: [
"' OR '1'='1",
"'; DROP TABLE users; --",
"1' UNION SELECT NULL--",
"admin'--",
"' OR 1=1--",
],
// XSS test cases
xssPayloads: [
"",
"
",
"javascript:alert('XSS')",
"