or run

tessl search
Log in

Version

Files

tile.json

rubric.jsonevals/scenario-6/

{
  "context": "Evaluates how the helper uses nock to install and manage HTTP mocks for the product search service. Focuses on path and query matchers, including repeated query params and encoded values, plus proper setup/cleanup hooks for pending expectations.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Scoped setup",
      "description": "Uses nock(baseUrl, ...) scopes (not global overrides) to register interceptors and configures teardown with cleanAll()/restore on resetCatalogMocks or the returned handle.",
      "max_score": 15
    },
    {
      "name": "Dynamic path match",
      "description": "Mocks GET /products/<sku> with a RegExp or function path matcher (e.g., get(/\\/products\\/[^/]+/)) and uses reply callback params (uri/requestBody) to echo the requested sku in the JSON response instead of hardcoding a sku.",
      "max_score": 30
    },
    {
      "name": "Repeated tags query",
      "description": "Mocks GET /search with .query(...) so q plus repeated tags are matched via nock's query matcher (object/array or predicate) independent of ordering, rather than manual string parsing; response includes tags/q pulled from the matched query.",
      "max_score": 25
    },
    {
      "name": "Encoded category match",
      "description": "Differentiates encoded category queries by enabling encodedQueryParams or matching an explicitly encoded query string (e.g., get('/search?category=home%2Fdecor') or query(q => q.category === 'home%2Fdecor')) so unencoded 'home/decor' does not hit the mock.",
      "max_score": 20
    },
    {
      "name": "Pending inspection",
      "description": "Implements pending() via nock's pendingMocks()/isDone() on the created scopes to report outstanding expectations, and uses restore()/cleanAll() on cleanup.",
      "max_score": 10
    }
  ]
}