IKivan-kozenko -aqa
Try yourself as a QA tester
Back to topic

Quiz

Mock APIs

Check yourself

  1. 1.You want a test to always see exactly 3 orders regardless of the database state. Which approach is cleanest?
  2. 2.When is a HAR file better than writing inline route handlers?
  3. 3.What is the difference between route.fulfill() and route.abort() in a page.route() handler?
  4. 4.You have a route handler set up for '*/**/api/orders'. A request to '/api/users' is made. What happens to that request?
  5. 5.How do you write a glob pattern in page.route() to match any URL containing '/api/orders' regardless of origin?
  6. 6.You set up a route mock in a test but want to remove it partway through so subsequent requests go to the real server. What do you call?
  7. 7.You want to mock an API endpoint using data from a local JSON file. What is the correct approach?
  8. 8.When using route.fetch() to get the real response and then route.fulfill({ response, json }), why do you pass the original response object?