mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
19 lines
433 B
TypeScript
19 lines
433 B
TypeScript
import { Request } from 'express';
|
|
import MockExpressRequest from 'mock-express-request';
|
|
|
|
function doSomethingWithRequest(req: Request): void {
|
|
console.log(req.headers);
|
|
}
|
|
|
|
function testMockExpressRequest() {
|
|
doSomethingWithRequest(MockExpressRequest());
|
|
|
|
doSomethingWithRequest(
|
|
MockExpressRequest({
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
}),
|
|
);
|
|
}
|