docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
{
"context": "Evaluates how well the solution uses nock to define base-URL HTTP interceptors for GET/POST stubs, enforce single-use behavior, and verify consumption/reset behavior described in the mock harness spec. Checks prioritize direct use of nock scope/verb APIs rather than ad-hoc HTTP handling or custom mock logic.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Scoped base URL",
"description": "Creates intercept scopes with `nock(baseUrl)` (supporting http/https) and reuses that scope for registering harness mocks instead of per-call host strings.",
"max_score": 25
},
{
"name": "GET intercept",
"description": "Registers GET handlers with `.get(path)` and `.reply(status, body)` (optionally combined with `.once()` or default single-use) so one request to each path returns the configured JSON and status (default 200) and additional calls fail without another registration.",
"max_score": 25
},
{
"name": "POST body match",
"description": "Uses `.post(path, expectedBody)` (or a matcher function) combined with `.reply(status, body)` to ensure only the specified JSON payload triggers the response and mismatched bodies lead to an unmet-mock error or explicit 4xx reply, honoring the default 201 status when none is provided.",
"max_score": 20
},
{
"name": "Consumption check",
"description": "Implements `assertAllConsumed` with `scope.isDone()` or `nock.isDone()` and reports outstanding intercepts using `pendingMocks()` so unhit paths/verbs are surfaced.",
"max_score": 20
},
{
"name": "Reset handling",
"description": "Resets harness state by calling `nock.cleanAll()`/`abortPendingRequests()` or rebuilding scopes so previously registered interceptors and pending expectations are cleared before the next run.",
"max_score": 10
}
]
}