CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-nock

HTTP server mocking and expectations library for Node.js testing environments

67

0.98x
Quality

Pending

Does it follow best practices?

Impact

67%

0.98x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-2/

{
  "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
    }
  ]
}

tile.json