@types/sinon-express-mock
Version:
TypeScript definitions for sinon-express-mock
71 lines (60 loc) • 2.12 kB
Markdown
# Installation
> `npm install --save @types/sinon-express-mock`
# Summary
This package contains type definitions for sinon-express-mock (https://github.com/danawoodman/sinon-express-mock#readme).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon-express-mock.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon-express-mock/index.d.ts)
````ts
import { SinonStub } from "sinon";
import { Request, Response } from "express";
export namespace mockReq {
interface MockReq {
accepts: SinonStub;
acceptsCharsets: SinonStub;
acceptsEncodings: SinonStub;
acceptsLanguages: SinonStub;
body: object;
flash: SinonStub;
get: SinonStub;
is: SinonStub;
params: object;
query: object;
session: object;
}
}
export namespace mockRes {
interface MockRes {
append: SinonStub;
attachement: SinonStub;
clearCookie: SinonStub;
cookie: SinonStub;
download: SinonStub;
end: SinonStub;
format: object;
get: SinonStub;
headersSent: SinonStub;
json: SinonStub;
jsonp: SinonStub;
links: SinonStub;
locals: object;
location: SinonStub;
redirect: SinonStub;
render: SinonStub;
send: SinonStub;
sendFile: SinonStub;
sendStatus: SinonStub;
set: SinonStub;
status: SinonStub;
type: SinonStub;
vary: SinonStub;
}
}
export function mockReq<T extends object>(options?: T): mockReq.MockReq & T & Request;
export function mockRes<T extends object>(options?: T): mockRes.MockRes & T & Response;
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
* Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/sinon](https://npmjs.com/package/@types/sinon)
# Credits
These definitions were written by [Jared Chapiewsky](https://github.com/jpchip), and [Tomek Łaziuk](https://github.com/tlaziuk).