import { recursiveXssSanitize } from '../../src/povery'; import xss from 'xss'; // Mock xss module jest.mock('xss', () => { return jest.fn((str) => `SANITIZED_${str}`); }); describe('XSS Protection', () => { beforeEach(() => { // Reset the mock before each test (xss as jest.Mock).mockClear(); }); it('should sanitize string values', () => { const input = 'test'; recursiveXssSanitize(input); expect(xss).toHaveBeenCalledWith(input); }); it('should sanitize object keys and string values', () => { const input = { 'key