MCPcopy
hub / github.com/midwayjs/midway / createHttpRequest

Function createHttpRequest

packages/mock/src/client/http.ts:4–14  ·  view source on GitHub ↗
(
  app: T
)

Source from the content-addressed store, hash-verified

2import * as request from 'supertest';
3
4export function createHttpRequest<T extends IMidwayApplication<any>>(
5 app: T
6): request.SuperTest<request.Test> {
7 if ((app as any).callback2) {
8 return request((app as any).callback2());
9 } else if ((app as any).callback) {
10 return request((app as any).callback());
11 } else {
12 return request(app);
13 }
14}

Callers 15

index.test.tsFile · 0.90
index.test.tsFile · 0.90
index.test.tsFile · 0.90
withnosniffHeaderFunction · 0.90
redirectIgnoreSniffFunction · 0.90
noHSTSHeaderFunction · 0.90
noNOOpenHeaderFunction · 0.90
noSniffHeaderFunction · 0.90
withxframeHeaderFunction · 0.90
withcspHeaderFunction · 0.90
withHSTSHeaderFunction · 0.90

Calls 1

callbackMethod · 0.80

Tested by 15

withnosniffHeaderFunction · 0.72
redirectIgnoreSniffFunction · 0.72
noHSTSHeaderFunction · 0.72
noNOOpenHeaderFunction · 0.72
noSniffHeaderFunction · 0.72
withxframeHeaderFunction · 0.72
withcspHeaderFunction · 0.72
withHSTSHeaderFunction · 0.72
postWithCsrfTokenFunction · 0.72
postWithCsrfTokenRotateFunction · 0.72