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's event hooks to trace mocked traffic and capture unmatched calls for a single host. Scoring prioritizes correct attachment to Nock's emitters, proper scope setup for mocks, and cleanup that detaches listeners and restores network state.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Unmatched hook",
"description": "Records method and URL for unmatched requests by subscribing to Nock's global emitter (e.g., nock.emitter.on('no match', ...)) rather than manual bookkeeping.",
"max_score": 25
},
{
"name": "Request trace",
"description": "Attaches a scope-level request listener (scope.on('request', ...)) to push method, path, and body data into the trace log in the order calls are made.",
"max_score": 25
},
{
"name": "Reply trace",
"description": "Uses the scope's replied event (scope.on('replied', ...)) to append status and response payload details to the trace entries, keeping request/response pairing in sequence.",
"max_score": 20
},
{
"name": "Scoped mocking",
"description": "Creates mocks with nock(baseUrl, { allowUnmocked }) and configures endpoints via scope.intercept()/verb helpers plus .reply(...) to satisfy the mock(method, path, status, body, headers) API.",
"max_score": 15
},
{
"name": "Teardown cleanup",
"description": "Implements teardown by removing emitter/scope listeners and clearing mocks using Nock controls such as scope.persist(false), scope.removeAllListeners(), nock.cleanAll(), or nock.restore() to stop further interception.",
"max_score": 15
}
]
}