This package provides TypeScript ambient type declarations for the `chai-http` library. It originates from the `retyped` project, which aimed to offer curated typings for various JavaScript libraries. However, the `retyped` project itself appears to be abandoned, with most packages, including this one, maintaining a `0.0.0-0` version number, indicating no active development or updates. Modern `chai-http` (version 4.2.4 and above) ships with its own built-in TypeScript definitions, making external typing packages like `retyped-chai-http-tsd-ambient` largely obsolete. Users are generally advised to rely on `chai-http`'s native types rather than this unmaintained package or even the stub `@types/chai-http` package.
npm install retyped-chai-http-tsd-ambientVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic TypeScript test setup using `chai`, `chai-http`, and `mocha` to make and assert HTTP requests against a simple Express.js application, leveraging the provided typings.
Migrate to `chai-http`'s built-in type definitions, as `chai-http` (v4.2.4+) now ships with its own types. Remove `retyped-chai-http-tsd-ambient` and `@types/chai-http` (which is a stub).
Uninstall `retyped-chai-http-tsd-ambient` and `@types/chai-http`. Ensure `chai-http` is updated to a version that includes its own types (e.g., `npm install chai-http@latest`).
Use ES module imports: `import chaiHttp from 'chai-http';` or, for explicit CommonJS type augmentation in older setups, `import chaiHttp = require('chai-http');`.Install `@types/superagent` as a devDependency: `npm install --save-dev @types/superagent`. This typically resolves issues with missing HTTP method types on `chai.request` objects.
Ensure `chai-http` is installed and updated to a version with built-in types. Remove `retyped-chai-http-tsd-ambient` and `@types/chai-http`. If using an older `chai-http` version, ensure `import chaiHttp = require('chai-http');` is used in CommonJS contexts.Install `@types/superagent` as a development dependency: `npm install --save-dev @types/superagent`. This provides the necessary declarations for the HTTP methods.
Ensure `chai-http` is installed and that its version includes built-in types. If not, consider upgrading `chai-http` or manually installing `@types/chai-http` (though `chai-http`'s native types are preferred if available). Confirm your `tsconfig.json` includes `node_modules/@types` in `typeRoots` or similar.
Ensure all relevant typing packages (`chai`, `chai-http`, `superagent`) are installed and properly configured. Explicitly type the callback parameters (e.g., `(err: any, res: ChaiHttp.Response) => { ... }`) as a temporary workaround, but the root cause is usually missing or conflicting types.