A developer uses AWS Amplify Hosting and wants to add end-to-end testing to reduce bugs before production. Where should the developer add E2E tests so they run during the Amplify build process?
Choose an answer
Tap an option to check your answer.
Correct answer: Include a test phase in the application's amplify.yml build settings..
Why this is the answer
The correct approach is to include a test phase in the application's amplify.yml build settings. AWS Amplify Hosting uses this file to define the build process, including various phases like preBuild, build, and postBuild. By adding a test phase, you can specify commands to execute your end-to-end tests as part of the continuous integration/continuous deployment (CI/CD) pipeline. If tests fail, the deployment can be halted, preventing faulty code from reaching production. Running amplify add test is for adding backend testing (e.g., Lambda function tests), not for integrating E2E tests into the Amplify Hosting build pipeline. Writing unit tests in the app and deploying them with amplify push only deploys the application code; it doesn't automatically execute tests during the build. The aws-exports.js file contains configuration details for connecting the frontend to AWS services and is not used for defining build phases or test execution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed