@types/supertest
Advanced tools
Comparing version 2.0.11 to 2.0.16
@@ -1,13 +0,6 @@ | ||
// Type definitions for SuperTest v2.0.1 | ||
// Project: https://github.com/visionmedia/supertest | ||
// Definitions by: Alex Varju <https://github.com/varju> | ||
// Petteri Parkkila <https://github.com/pietu> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 3.0 | ||
import * as superagent from "superagent"; | ||
import * as superagent from 'superagent'; | ||
export = supertest; | ||
declare function supertest(app: any): supertest.SuperTest<supertest.Test>; | ||
declare function supertest(app: any, options?: supertest.Options): supertest.SuperTest<supertest.Test>; | ||
declare namespace supertest { | ||
@@ -34,3 +27,7 @@ interface Response extends superagent.Response {} | ||
interface AgentOptions { | ||
interface Options { | ||
http2?: boolean; | ||
} | ||
interface AgentOptions extends Options { | ||
ca?: any; | ||
@@ -40,28 +37,30 @@ } | ||
type SuperAgentTest = SuperTest<Test> & | ||
Pick< | ||
interface SuperTest<T extends superagent.SuperAgentRequest> extends superagent.SuperAgent<T> {} | ||
interface SuperTestWithHost<T extends superagent.SuperAgentRequest> extends SuperTest<T> { | ||
host(host: string): this; | ||
} | ||
type SuperAgentTest = | ||
& SuperTestWithHost<Test> | ||
& Pick< | ||
Request, | ||
| 'use' | ||
| 'on' | ||
| 'set' | ||
| 'query' | ||
| 'type' | ||
| 'accept' | ||
| 'auth' | ||
| 'withCredentials' | ||
| 'retry' | ||
| 'ok' | ||
| 'redirects' | ||
| 'timeout' | ||
| 'buffer' | ||
| 'serialize' | ||
| 'parse' | ||
| 'ca' | ||
| 'key' | ||
| 'pfx' | ||
| 'cert' | ||
| "use" | ||
| "on" | ||
| "set" | ||
| "query" | ||
| "type" | ||
| "accept" | ||
| "auth" | ||
| "withCredentials" | ||
| "retry" | ||
| "ok" | ||
| "redirects" | ||
| "timeout" | ||
| "buffer" | ||
| "serialize" | ||
| "parse" | ||
| "ca" | ||
| "key" | ||
| "pfx" | ||
| "cert" | ||
>; | ||
interface SuperTest<T extends superagent.SuperAgentRequest> extends superagent.SuperAgent<T> { | ||
host(host: string): T; | ||
} | ||
} |
{ | ||
"name": "@types/supertest", | ||
"version": "2.0.11", | ||
"description": "TypeScript definitions for SuperTest", | ||
"version": "2.0.16", | ||
"description": "TypeScript definitions for supertest", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest", | ||
"license": "MIT", | ||
@@ -9,9 +10,9 @@ "contributors": [ | ||
"name": "Alex Varju", | ||
"url": "https://github.com/varju", | ||
"githubUsername": "varju" | ||
"githubUsername": "varju", | ||
"url": "https://github.com/varju" | ||
}, | ||
{ | ||
"name": "Petteri Parkkila", | ||
"url": "https://github.com/pietu", | ||
"githubUsername": "pietu" | ||
"githubUsername": "pietu", | ||
"url": "https://github.com/pietu" | ||
} | ||
@@ -30,4 +31,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "0f31fa99a5ee4543e053b2a6928741a84d93c4f67e162ac77fb4c5c499cb1a6f", | ||
"typeScriptVersion": "3.5" | ||
"typesPublisherContentHash": "3a50772627b3dc578ba000f0b0f17070659a1541d7eb962d2bc4b3f187d7d813", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -5,13 +5,80 @@ # Installation | ||
# Summary | ||
This package contains type definitions for SuperTest (https://github.com/visionmedia/supertest). | ||
This package contains type definitions for supertest (https://github.com/visionmedia/supertest). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supertest/index.d.ts) | ||
````ts | ||
import * as superagent from "superagent"; | ||
export = supertest; | ||
declare function supertest(app: any, options?: supertest.Options): supertest.SuperTest<supertest.Test>; | ||
declare namespace supertest { | ||
interface Response extends superagent.Response {} | ||
interface Request extends superagent.SuperAgentRequest {} | ||
type CallbackHandler = (err: any, res: Response) => void; | ||
interface Test extends superagent.SuperAgentRequest { | ||
app?: any; | ||
url: string; | ||
serverAddress(app: any, path: string): string; | ||
expect(status: number, callback?: CallbackHandler): this; | ||
expect(status: number, body: any, callback?: CallbackHandler): this; | ||
expect(checker: (res: Response) => any, callback?: CallbackHandler): this; | ||
expect(body: string, callback?: CallbackHandler): this; | ||
expect(body: RegExp, callback?: CallbackHandler): this; | ||
expect(body: Object, callback?: CallbackHandler): this; | ||
expect(field: string, val: string, callback?: CallbackHandler): this; | ||
expect(field: string, val: RegExp, callback?: CallbackHandler): this; | ||
end(callback?: CallbackHandler): this; | ||
} | ||
interface Options { | ||
http2?: boolean; | ||
} | ||
interface AgentOptions extends Options { | ||
ca?: any; | ||
} | ||
function agent(app?: any, options?: AgentOptions): SuperAgentTest; | ||
interface SuperTest<T extends superagent.SuperAgentRequest> extends superagent.SuperAgent<T> {} | ||
interface SuperTestWithHost<T extends superagent.SuperAgentRequest> extends SuperTest<T> { | ||
host(host: string): this; | ||
} | ||
type SuperAgentTest = | ||
& SuperTestWithHost<Test> | ||
& Pick< | ||
Request, | ||
| "use" | ||
| "on" | ||
| "set" | ||
| "query" | ||
| "type" | ||
| "accept" | ||
| "auth" | ||
| "withCredentials" | ||
| "retry" | ||
| "ok" | ||
| "redirects" | ||
| "timeout" | ||
| "buffer" | ||
| "serialize" | ||
| "parse" | ||
| "ca" | ||
| "key" | ||
| "pfx" | ||
| "cert" | ||
>; | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Wed, 31 Mar 2021 04:31:11 GMT | ||
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT | ||
* Dependencies: [@types/superagent](https://npmjs.com/package/@types/superagent) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by [Alex Varju](https://github.com/varju), and [Petteri Parkkila](https://github.com/pietu). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7060
0
84
57