import { ArgumentMetadata } from '@nestjs/common'; import { RpcValidationPipe } from '../../pipes/rpc.validation-pipe'; import { MatchRequest } from '../../../matcher/domain/dtos/match.request'; describe('RpcValidationPipe', () => { it('should not validate request', async () => { const target: RpcValidationPipe = new RpcValidationPipe({ whitelist: true, forbidUnknownValues: false, }); const metadata: ArgumentMetadata = { type: 'body', metatype: MatchRequest, data: '', }; await target.transform({}, metadata).catch((err) => { expect(err.message).toEqual('Rpc Exception'); }); }); });