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 the helper uses nock to intercept outbound calls by matching request bodies of different shapes and ensures mocks are verified and cleaned up. Checks center on body matchers (object + regex, predicate functions, binary buffers) and lifecycle controls for verification and teardown.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Scoped setup",
"description": "Creates nock scopes bound to the provided base URL (including protocol/port) so all mocks target the correct host instead of global fallbacks.",
"max_score": 10
},
{
"name": "Webhook match",
"description": "Uses nock's JSON body matcher (object plus RegExp for payload.id and nested metadata) on a POST to /webhook, replying with 202 and the accepted body only when the event name matches.",
"max_score": 25
},
{
"name": "NDJSON predicate",
"description": "Defines the /metrics mock with a body matcher function (or regex) that validates the NDJSON string contains both http.latency and db.connections lines before replying 200 with 'ok'.",
"max_score": 20
},
{
"name": "Binary matcher",
"description": "Sets up the /upload mock using a Buffer-aware matcher (e.g., predicate checking PNG signature bytes or Buffer.compare) before replying 201 with 'stored'.",
"max_score": 20
},
{
"name": "Verification",
"description": "assertComplete() calls nock.done()/isDone() (or equivalent per-scope done) and surfaces unmet expectations so pending mocks fail the check.",
"max_score": 15
},
{
"name": "Cleanup",
"description": "cleanup() tears down mocks via nock.cleanAll() or scope cleanup to prevent leaked interceptors between tests.",
"max_score": 10
}
]
}