XMLHttpRequest for Node.js that emulates the browser XMLHttpRequest object
Overall
score
75%
{
"context": "Evaluates whether the solution uses the xmlhttprequest package to retrieve UTF-8 local files over the file:// protocol, handling both async and sync reads plus missing-file errors as required by the spec.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Async GET",
"description": "Uses xmlhttprequest's XMLHttpRequest to perform an asynchronous GET to a file:// URL (e.g., open('GET', url, true) then send()), rather than other I/O primitives.",
"max_score": 30
},
{
"name": "Async completion",
"description": "Resolves the async read only after the XHR reaches DONE (via onreadystatechange/readyState === XMLHttpRequest.DONE or onload), returning responseText for the loaded file.",
"max_score": 20
},
{
"name": "Missing file errors",
"description": "Detects missing-file failures using XHR facilities (status/readyState error path or onerror) and rejects with an Error that includes the requested filename.",
"max_score": 20
},
{
"name": "Sync GET",
"description": "Implements the synchronous entry point with XMLHttpRequest opened in sync mode (open('GET', url, false)), calling send() and returning responseText without promise wrappers.",
"max_score": 20
},
{
"name": "UTF-8 text handling",
"description": "Ensures text content is read as UTF-8 through the XHR (relying on the package's default file decoding or explicitly calling overrideMimeType with a UTF-8 mime type).",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-xmlhttprequestdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10