Chapter quiz · Testing & Production

Test what you learned.

8 questions on Testing & Production. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Testing & Production — Chapter Quiz

Eight questions on app.inject, supertest, Vitest, health checks and metrics, response-schema performance, Docker multi-stage builds, PM2 cluster mode, and debugging.

0/ 9
  1. Question 1
    1

    What's the main advantage of app.inject() over a real HTTP request in tests?

  2. Question 2
    2

    Before using supertest against app.server, you must await app.ready().

  3. Question 3
    3

    Which Vitest command runs tests once and exits (suitable for CI)?

  4. Question 4
    4

    A common health-check endpoint path is /____, returning a small JSON body and 200.

  5. Question 5
    5

    Why does adding a response schema improve performance?

  6. Question 6
    6

    What is the main benefit of this Dockerfile shape?

    FROM node:20-alpine AS build
    RUN npm ci && npm run build
    
    FROM node:20-alpine
    COPY --from=build /app/dist ./dist
    
  7. Question 7
    7

    What does PM2's exec_mode: 'cluster' with instances: 'max' do?

  8. Question 8
    8

    Which steps help you attach a debugger to a TypeScript Fastify app?

    Select all that apply.

Pick an answer — instant feedback as you go.