mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2025-12-30 22:32:40 +00:00
refactor to ddh, first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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(<MatchRequest>{}, metadata).catch((err) => {
|
||||
expect(err.message).toEqual('Rpc Exception');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user