fix rpc validation tests
This commit is contained in:
parent
5fbc399924
commit
7c6bf016f6
|
@ -1,6 +1,6 @@
|
||||||
import { ArgumentMetadata } from '@nestjs/common';
|
import { ArgumentMetadata } from '@nestjs/common';
|
||||||
import { UpdateUserRequest } from '../../../modules/user/domain/dtos/update-user.request';
|
|
||||||
import { RpcValidationPipe } from '../../pipes/rpc.validation-pipe';
|
import { RpcValidationPipe } from '../../pipes/rpc.validation-pipe';
|
||||||
|
import { FindAdByUuidRequest } from '../../../modules/ad/domain/dtos/find-ad-by-uuid.request';
|
||||||
|
|
||||||
describe('RpcValidationPipe', () => {
|
describe('RpcValidationPipe', () => {
|
||||||
it('should not validate request', async () => {
|
it('should not validate request', async () => {
|
||||||
|
@ -10,10 +10,10 @@ describe('RpcValidationPipe', () => {
|
||||||
});
|
});
|
||||||
const metadata: ArgumentMetadata = {
|
const metadata: ArgumentMetadata = {
|
||||||
type: 'body',
|
type: 'body',
|
||||||
metatype: UpdateUserRequest,
|
metatype: FindAdByUuidRequest,
|
||||||
data: '',
|
data: '',
|
||||||
};
|
};
|
||||||
await target.transform(<UpdateUserRequest>{}, metadata).catch((err) => {
|
await target.transform(<FindAdByUuidRequest>{}, metadata).catch((err) => {
|
||||||
expect(err.message).toEqual('Rpc Exception');
|
expect(err.message).toEqual('Rpc Exception');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue