Igor Sharfman
06/12/2022, 3:06 PMJulian Schmidt
08/16/2022, 11:52 AM{
messageId: '234857239457234',
data: 'ewpmb286ICdiYXInCn0='
}
The json payload is base64 encoded.
The nestjs controller/route uses a pipe to convert the base64 encoded payload back to json format. Theres also a validation pipe that checks if the data is valid.
@Controller('orders')
export class OrdersController {
public constructor(private readonly ordersService: OrdersService) {}
@Post('events/order-placed')
@UsePipes(new PubsubPipe<OrderPlacedEvent>(), new ValidationPipe())
public async create(@Body() createOrderDto: OrderPlacedEvent): Promise<void> {
await this.ordersService.create(createOrderDto);
}
}
The messaging approach doesn't make a request and thus the pipes are not invoked. Should we find a way to still invoke the pipes when just calling the method (With the syncronousBodyHandler)? Or should we make a request with something like supertest? But how would the verify argument look like?
Also we would like to write a typesafe test. Is there a way to use typescript to its fullest and have compilation errors when you define the expected objected and it doesn't match the Endpoint/Controller method?Taylor King
08/25/2022, 8:14 PMLennart Querter
09/08/2022, 11:42 AMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Lennart Querter
11/30/2022, 2:21 PMYousaf Nabi (pactflow.io)
Lennart Querter
11/30/2022, 2:53 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
fail-fast: false
to the matrix, it won't hard exit if one job fails, which is good if you are testing behaviour between the diff node versions it runsLennart Querter
11/30/2022, 3:42 PMLennart Querter
11/30/2022, 3:43 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
next
not master
Yousaf Nabi (pactflow.io)
Lennart Querter
11/30/2022, 3:58 PMLennart Querter
11/30/2022, 3:58 PMYousaf Nabi (pactflow.io)