Test Quality Control
Learn how to test quality control that includes Parallel state.
We'll cover the following...
Now, we can test our flow. The first step is to deploy the project. Click the “Run” button, and then use the sls deploy
command.
import { APIGatewayProxyEvent, APIGatewayProxyHandler, APIGatewayProxyResult, } from "aws-lambda"; import { validate as uuidValidate } from "uuid"; export const handler: APIGatewayProxyHandler = async ( event: APIGatewayProxyEvent ): Promise<APIGatewayProxyResult> => { const batchId = event.body?.batchId; if (batchId && uuidValidate(batchId)) { return { validApiQualityCheck: true }; } else { throw new Error("Quality check failed: invalid batch ID"); } };
Project
Testing quality control flow
After the deployment ...