or run

tessl search
Log in

Version

Files

tile.json

rubric.jsonevals/scenario-8/

{
  "context": "Evaluates how well the solution uses nock's response definition APIs to prime single-use replies and request-level errors for the order service mock. Focuses on correctly shaping statuses, bodies, and headers rather than general code style.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Scoped setup",
      "description": "Mocks are created with nock using the provided base URL and method/path matchers for /health, /orders, and /orders/{id}, ensuring interceptors are single-use or cleaned up.",
      "max_score": 20
    },
    {
      "name": "Health reply",
      "description": "GET /health interceptor uses nock.reply with status 200, JSON body {status:\"ok\"}, and header x-mock: health.",
      "max_score": 20
    },
    {
      "name": "Dynamic order reply",
      "description": "POST /orders interceptor uses nock.reply callback (sync or async) that inspects the request body to echo amount and currency and generates a non-empty id in a 201 response.",
      "max_score": 25
    },
    {
      "name": "Request error",
      "description": "Invalid order payload is handled with nock.replyWithError (or equivalent request error) so the POST rejects without an HTTP response, carrying the primed message.",
      "max_score": 20
    },
    {
      "name": "Outage response",
      "description": "GET /orders/{id} interceptor uses nock.reply to return 503 with JSON {error:\"outage\"} and sets retry-after header to 120.",
      "max_score": 15
    }
  ]
}