import { User } from '@db/entities/User'; describe('User Entity', () => { describe('JSON.stringify', () => { it('should not serialize sensitive data', () => { const user = Object.assign(new User(), { email: 'test@example.com', firstName: 'Don', lastName: 'Joe', password: '123456789', apiKey: '123', mfaSecret: '123', mfaRecoveryCodes: ['123'], }); expect(JSON.stringify(user)).toEqual( '{"email":"test@example.com","firstName":"Don","lastName":"Joe"}', ); }); }); });