RESTful HTTP client library with composable interceptor architecture for Node.js and browsers
76
{
"context": "This evaluation assesses how well the engineer uses the rest.js package's lazy promise evaluation capability to implement conditional HTTP requests. The focus is on proper usage of deferred promise execution patterns to avoid immediate request execution.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses rest client",
"description": "Imports and uses the rest.js HTTP client (e.g., `require('rest')` or `import rest from 'rest'`) to make HTTP requests rather than implementing custom HTTP functionality.",
"max_score": 15
},
{
"name": "Implements lazy evaluation",
"description": "Uses a lazy promise pattern (such as rest's internal lazy promise mechanism or wrapping rest calls in a function that returns a promise) to defer HTTP request execution until the promise is consumed via .then() or similar methods.",
"max_score": 30
},
{
"name": "Defers execution correctly",
"description": "Ensures HTTP requests are NOT executed immediately when createConditionalRequest is called, but only when the returned promise's .then(), .catch(), or similar methods are invoked.",
"max_score": 25
},
{
"name": "Passes request configuration",
"description": "Correctly passes the request configuration object (path, method, headers, entity) to the rest client, maintaining the structure expected by rest.js (e.g., rest({ path: '...', method: '...' })).",
"max_score": 15
},
{
"name": "Returns chainable promise",
"description": "Returns a promise-like object that supports standard promise chaining operations (.then(), .catch()) and properly propagates the rest.js response structure through the chain.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-restevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10