@tsed/platform-test-sdk 7.79.4 → 7.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/lib/cjs/tests/testHeaders.js +8 -24
  2. package/lib/cjs/tests/testHeaders.js.map +1 -1
  3. package/lib/cjs/tests/testInheritanceController.js +2 -1
  4. package/lib/cjs/tests/testInheritanceController.js.map +1 -1
  5. package/lib/cjs/tests/testMulter.js +5 -3
  6. package/lib/cjs/tests/testMulter.js.map +1 -1
  7. package/lib/cjs/tests/testRouting.js +4 -2
  8. package/lib/cjs/tests/testRouting.js.map +1 -1
  9. package/lib/cjs/tests/testStream.js +1 -1
  10. package/lib/esm/tests/testHeaders.js +8 -24
  11. package/lib/esm/tests/testHeaders.js.map +1 -1
  12. package/lib/esm/tests/testInheritanceController.js +2 -1
  13. package/lib/esm/tests/testInheritanceController.js.map +1 -1
  14. package/lib/esm/tests/testMulter.js +6 -4
  15. package/lib/esm/tests/testMulter.js.map +1 -1
  16. package/lib/esm/tests/testRouting.js +4 -2
  17. package/lib/esm/tests/testRouting.js.map +1 -1
  18. package/lib/esm/tests/testStream.js +1 -1
  19. package/lib/types-esm/components/PlatformTestSdk.d.ts +9 -0
  20. package/lib/types-esm/errors/CustomBadRequest.d.ts +8 -0
  21. package/lib/types-esm/errors/CustomInternalError.d.ts +8 -0
  22. package/lib/types-esm/interfaces/PlatformTestingSdkOpts.d.ts +8 -0
  23. package/lib/types-esm/modules/feature/FeatureModule.d.ts +2 -0
  24. package/lib/types-esm/modules/feature/controllers/FeatureController.d.ts +3 -0
  25. package/lib/types-esm/tests/exports.d.ts +2 -0
  26. package/lib/types-esm/tests/testAcceptMime.d.ts +2 -0
  27. package/lib/types-esm/tests/testAuth.d.ts +8 -0
  28. package/lib/types-esm/tests/testBodyParams.d.ts +3 -0
  29. package/lib/types-esm/tests/testCache.d.ts +2 -0
  30. package/lib/types-esm/tests/testChildrenControllers.d.ts +2 -0
  31. package/lib/types-esm/tests/testCookies.d.ts +11 -0
  32. package/lib/types-esm/tests/testCustom404.d.ts +2 -0
  33. package/lib/types-esm/tests/testDeepQueryParams.d.ts +3 -0
  34. package/lib/types-esm/tests/testErrors.d.ts +19 -0
  35. package/lib/types-esm/tests/testHandlers.d.ts +12 -0
  36. package/lib/types-esm/tests/testHeaderParams.d.ts +16 -0
  37. package/lib/types-esm/tests/testHeaders.d.ts +8 -0
  38. package/lib/types-esm/tests/testInheritanceController.d.ts +42 -0
  39. package/lib/types-esm/tests/testLocals.d.ts +2 -0
  40. package/lib/types-esm/tests/testLocation.d.ts +2 -0
  41. package/lib/types-esm/tests/testMiddlewares.d.ts +8 -0
  42. package/lib/types-esm/tests/testModule.d.ts +2 -0
  43. package/lib/types-esm/tests/testMulter.d.ts +21 -0
  44. package/lib/types-esm/tests/testPathParams.d.ts +2 -0
  45. package/lib/types-esm/tests/testQueryParams.d.ts +6 -0
  46. package/lib/types-esm/tests/testRedirect.d.ts +2 -0
  47. package/lib/types-esm/tests/testResponse.d.ts +16 -0
  48. package/lib/types-esm/tests/testResponseFilter.d.ts +2 -0
  49. package/lib/types-esm/tests/testRouting.d.ts +7 -0
  50. package/lib/types-esm/tests/testScopeRequest.d.ts +12 -0
  51. package/lib/types-esm/tests/testSession.d.ts +16 -0
  52. package/lib/types-esm/tests/testStatics.d.ts +2 -0
  53. package/lib/types-esm/tests/testStream.d.ts +2 -0
  54. package/lib/types-esm/tests/testView.d.ts +2 -0
  55. package/package.json +22 -20
  56. package/lib/cjs/package.json +0 -3
  57. package/lib/esm/package.json +0 -3
  58. package/lib/tsconfig.esm.tsbuildinfo +0 -1
  59. package/lib/tsconfig.tsbuildinfo +0 -1
  60. package/src/components/PlatformTestSdk.ts +0 -29
  61. package/src/data/file.txt +0 -1
  62. package/src/data/response.data.json +0 -3
  63. package/src/data/swagger.json +0 -32
  64. package/src/errors/CustomBadRequest.ts +0 -16
  65. package/src/errors/CustomInternalError.ts +0 -16
  66. package/src/interfaces/PlatformTestingSdkOpts.ts +0 -10
  67. package/src/modules/feature/FeatureModule.ts +0 -9
  68. package/src/modules/feature/controllers/FeatureController.ts +0 -11
  69. package/src/tests/exports.ts +0 -71
  70. package/src/tests/testAcceptMime.ts +0 -95
  71. package/src/tests/testAuth.ts +0 -339
  72. package/src/tests/testBodyParams.ts +0 -483
  73. package/src/tests/testCache.ts +0 -279
  74. package/src/tests/testChildrenControllers.ts +0 -55
  75. package/src/tests/testCookies.ts +0 -36
  76. package/src/tests/testCustom404.ts +0 -33
  77. package/src/tests/testDeepQueryParams.ts +0 -120
  78. package/src/tests/testErrors.ts +0 -226
  79. package/src/tests/testHandlers.ts +0 -90
  80. package/src/tests/testHeaderParams.ts +0 -152
  81. package/src/tests/testHeaders.ts +0 -91
  82. package/src/tests/testInheritanceController.ts +0 -200
  83. package/src/tests/testLocals.ts +0 -46
  84. package/src/tests/testLocation.ts +0 -37
  85. package/src/tests/testMiddlewares.ts +0 -159
  86. package/src/tests/testModule.ts +0 -46
  87. package/src/tests/testMulter.ts +0 -151
  88. package/src/tests/testPathParams.ts +0 -123
  89. package/src/tests/testQueryParams.ts +0 -233
  90. package/src/tests/testRedirect.ts +0 -124
  91. package/src/tests/testResponse.ts +0 -528
  92. package/src/tests/testResponseFilter.ts +0 -101
  93. package/src/tests/testRouting.ts +0 -65
  94. package/src/tests/testScopeRequest.ts +0 -111
  95. package/src/tests/testSession.ts +0 -103
  96. package/src/tests/testStatics.ts +0 -61
  97. package/src/tests/testStream.ts +0 -59
  98. package/src/tests/testView.ts +0 -68
  99. package/tsconfig.esm.json +0 -63
  100. package/tsconfig.json +0 -63
  101. /package/{src/index.ts → lib/types-esm/index.d.ts} +0 -0
  102. /package/{src/interfaces/index.ts → lib/types-esm/interfaces/index.d.ts} +0 -0
@@ -1,226 +0,0 @@
1
- import "@tsed/ajv";
2
- import {BodyParams, Controller, Err, Get, Middleware, PlatformTest, Post, UseAfter} from "@tsed/common";
3
- import {Env} from "@tsed/core";
4
- import {BadRequest, InternalServerError} from "@tsed/exceptions";
5
- import {Description, Name, Required, Returns, Summary} from "@tsed/schema";
6
- import SuperTest from "supertest";
7
- import {CustomBadRequest} from "../errors/CustomBadRequest.js";
8
- import {CustomInternalError} from "../errors/CustomInternalError.js";
9
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
10
-
11
- class CustomModel {
12
- @Required() name: string;
13
- }
14
-
15
- class CustomPropModel {
16
- @Name("role_item")
17
- @Required()
18
- roleItem: string;
19
- }
20
-
21
- @Middleware()
22
- class ErrorMiddleware {
23
- use(@Err() error: any) {
24
- return {
25
- message: "no error"
26
- };
27
- }
28
- }
29
-
30
- @Middleware()
31
- class FakeMiddleware {
32
- use() {
33
- return {
34
- message: "should not be called by the platform when endpoint throw an error"
35
- };
36
- }
37
- }
38
-
39
- @Controller("/errors")
40
- export class ErrorsCtrl {
41
- @Get("/scenario-1")
42
- @Returns(500, InternalServerError).Description("Custom Bad Request")
43
- public scenario1() {
44
- throw new CustomBadRequest("Custom Bad Request");
45
- }
46
-
47
- @Get("/scenario-2")
48
- @Returns(500).Description("Internal Server Error")
49
- public scenario2() {
50
- throw new Error("My error");
51
- }
52
-
53
- @Get("/scenario-3")
54
- @Returns(400, CustomInternalError).Description("Bad request")
55
- public scenario3() {
56
- throw new CustomInternalError("My custom error");
57
- }
58
-
59
- @Post("/scenario-4")
60
- @Returns(400)
61
- public scenario4(@Required() @BodyParams("name") name: string) {
62
- return name;
63
- }
64
-
65
- @Post("/scenario-5")
66
- @Returns(400, BadRequest).Description("Bad request")
67
- public scenario5(
68
- @Required()
69
- @BodyParams()
70
- model: CustomModel
71
- ) {
72
- return model;
73
- }
74
-
75
- @Post("/scenario-6")
76
- @Summary("Throw a Required prop if prop name is required")
77
- @Description(`Return a required error`)
78
- @Returns(400).Description("Bad request")
79
- public scenario6(
80
- @Required()
81
- @BodyParams()
82
- model: CustomPropModel
83
- ) {
84
- return model;
85
- }
86
-
87
- @Get("/scenario-7")
88
- @Returns(400).Description("Bad request")
89
- @UseAfter(FakeMiddleware)
90
- @UseAfter(ErrorMiddleware)
91
- public scenario7() {
92
- throw new CustomInternalError("My custom error");
93
- }
94
- }
95
-
96
- export function testErrors(options: PlatformTestingSdkOpts) {
97
- let request: SuperTest.Agent;
98
- beforeAll(
99
- PlatformTest.bootstrap(options.server, {
100
- ...options,
101
- env: Env.TEST,
102
- mount: {
103
- "/rest": [ErrorsCtrl]
104
- }
105
- })
106
- );
107
- beforeAll(() => {
108
- request = SuperTest(PlatformTest.callback());
109
- });
110
- afterAll(PlatformTest.reset);
111
-
112
- it("Scenario 1: GET /rest/errors/scenario-1", async () => {
113
- const response: any = await request.get("/rest/errors/scenario-1").expect(400);
114
-
115
- expect(response.headers["x-header-error"]).toEqual("deny");
116
- expect(response.body).toEqual({
117
- name: "CUSTOM_BAD_REQUEST",
118
- message: "Custom Bad Request",
119
- status: 400,
120
- errors: ["test"]
121
- });
122
- });
123
-
124
- it("Scenario 2: GET /rest/errors/scenario-2", async () => {
125
- const response: any = await request.get("/rest/errors/scenario-2").expect(500);
126
-
127
- expect(response.body).toEqual({
128
- errors: [],
129
- message: "My error",
130
- name: "Error",
131
- status: 500
132
- });
133
- });
134
-
135
- it("Scenario 3: GET /rest/errors/scenario-3", async () => {
136
- const response: any = await request.get("/rest/errors/scenario-3").expect(500);
137
-
138
- expect(response.headers["x-header-error"]).toEqual("deny");
139
- expect(response.body).toEqual({
140
- name: "CUSTOM_INTERNAL_SERVER_ERROR",
141
- message: "My custom error",
142
- status: 500,
143
- errors: ["test"]
144
- });
145
- });
146
-
147
- it("Scenario 4: POST /rest/errors/scenario-4", async () => {
148
- const response: any = await request.post("/rest/errors/scenario-4").expect(400);
149
-
150
- expect(response.body).toEqual({
151
- errors: [
152
- {
153
- dataPath: ".name",
154
- requestPath: "body",
155
- keyword: "required",
156
- message: "It should have required parameter 'name'",
157
- modelName: "body",
158
- params: {
159
- missingProperty: "name"
160
- },
161
- schemaPath: "#/required"
162
- }
163
- ],
164
- message: "Bad request on parameter \"request.body.name\".\nIt should have required parameter 'name'",
165
- name: "REQUIRED_VALIDATION_ERROR",
166
- status: 400
167
- });
168
- });
169
-
170
- it("Scenario 5: POST /rest/errors/scenario-5", async () => {
171
- const response: any = await request.post("/rest/errors/scenario-5").send({}).expect(400);
172
-
173
- expect(response.body).toEqual({
174
- errors: [
175
- {
176
- dataPath: ".name",
177
- requestPath: "body",
178
- instancePath: "",
179
- keyword: "required",
180
- message: "must have required property 'name'",
181
- modelName: "CustomModel",
182
- params: {
183
- missingProperty: "name"
184
- },
185
- schemaPath: "#/required"
186
- }
187
- ],
188
- message: 'Bad request on parameter "request.body".\nCustomModel must have required property \'name\'. Given value: "undefined"',
189
- name: "AJV_VALIDATION_ERROR",
190
- status: 400
191
- });
192
- });
193
-
194
- it("Scenario 6: POST /rest/errors/scenario-6", async () => {
195
- const response: any = await request.post(`/rest/errors/scenario-6`).send({}).expect(400);
196
-
197
- expect(response.body).toEqual({
198
- errors: [
199
- {
200
- dataPath: ".role_item",
201
- requestPath: "body",
202
- instancePath: "",
203
- keyword: "required",
204
- message: "must have required property 'role_item'",
205
- modelName: "CustomPropModel",
206
- params: {
207
- missingProperty: "role_item"
208
- },
209
- schemaPath: "#/required"
210
- }
211
- ],
212
- message:
213
- 'Bad request on parameter "request.body".\nCustomPropModel must have required property \'role_item\'. Given value: "undefined"',
214
- name: "AJV_VALIDATION_ERROR",
215
- status: 400
216
- });
217
- });
218
-
219
- it("Scenario 7: GET /rest/errors/scenario-7", async () => {
220
- const response: any = await request.get("/rest/errors/scenario-7").expect(200);
221
-
222
- expect(response.body).toEqual({
223
- message: "no error"
224
- });
225
- });
226
- }
@@ -1,90 +0,0 @@
1
- import {Context, Controller, Get, PathParams, PlatformTest} from "@tsed/common";
2
- import {Property, Required, Title} from "@tsed/schema";
3
- import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
-
6
- export class MyModel {
7
- @Title("ID")
8
- @Property()
9
- public id: string;
10
-
11
- @Property()
12
- @Required()
13
- public name: string;
14
- }
15
-
16
- @Controller("/handlers")
17
- export class HandlersCtrl {
18
- @Get("/scenario-1/:id") // Express style
19
- public scenario1(@PathParams("id") id: string): MyModel {
20
- const model = new MyModel();
21
- model.id = id;
22
- model.name = "test";
23
-
24
- return model;
25
- }
26
-
27
- @Get("/scenario-2/:id") // Ts.ED style with response injection
28
- public scenario2(
29
- @Context() ctx: Context,
30
- @PathParams("id")
31
- @Required()
32
- id: string
33
- ): void {
34
- const model = new MyModel();
35
- model.id = "1";
36
- model.name = "test";
37
-
38
- try {
39
- ctx.response.status(202).body(model);
40
- } catch (er) {
41
- console.log(er);
42
- }
43
- }
44
-
45
- @Get("/scenario-3/:id") // Ts.ED style
46
- public scenario3(@PathParams("id") id: string): Promise<any> {
47
- const model = new MyModel();
48
- model.id = id;
49
- model.name = "test";
50
-
51
- return Promise.resolve(model);
52
- }
53
- }
54
-
55
- export function testHandlers(options: PlatformTestingSdkOpts) {
56
- let request: SuperTest.Agent;
57
- beforeAll(
58
- PlatformTest.bootstrap(options.server, {
59
- ...options,
60
- logger: {},
61
- mount: {
62
- "/rest": [HandlersCtrl]
63
- }
64
- })
65
- );
66
- beforeAll(() => {
67
- request = SuperTest(PlatformTest.callback());
68
- });
69
- afterAll(PlatformTest.reset);
70
- it("Scenario 1: GET /rest/handlers/scenario-1/:id", async () => {
71
- const {body}: any = await request.get("/rest/handlers/scenario-1/1").expect(200);
72
-
73
- expect(body.id).toEqual("1");
74
- expect(body.name).toEqual("test");
75
- });
76
-
77
- it("Scenario 2: GET /rest/handlers/scenario-2/:id", async () => {
78
- const {body}: any = await request.get("/rest/handlers/scenario-2/1").expect(202);
79
-
80
- expect(body.id).toEqual("1");
81
- expect(body.name).toEqual("test");
82
- });
83
-
84
- it("Scenario 3: GET /rest/handlers/scenario-3/:id", async () => {
85
- const {body}: any = await request.get("/rest/handlers/scenario-3/1").expect(200);
86
-
87
- expect(body.id).toEqual("1");
88
- expect(body.name).toEqual("test");
89
- });
90
- }
@@ -1,152 +0,0 @@
1
- import {Context, Controller, Get, HeaderParams, Locals, Middleware, PlatformTest, Post, Req, Use} from "@tsed/common";
2
- import {Enum, Required} from "@tsed/schema";
3
- import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
-
6
- @Middleware()
7
- class SetId {
8
- use(@Req() request: any, @Locals() locals: any, @Context() $ctx: Context) {
9
- request["user"] = 1;
10
- locals.id = "local-10909";
11
- $ctx.set("uid", "ctx-10909");
12
- }
13
- }
14
-
15
- @Controller("/header-params")
16
- export class HeaderParamsCtrl {
17
- /**
18
- * Handle request with a raw middleware + handler
19
- * Get Authorization from header
20
- * @param request
21
- * @param auth
22
- */
23
- @Get("/scenario-1")
24
- @Use(SetId)
25
- public scenario1(@Req() request: Req, @HeaderParams("authorization") auth: string): any {
26
- return {
27
- user: (request as any).user,
28
- token: auth
29
- };
30
- }
31
-
32
- @Post("/scenario-2")
33
- scenario2(@HeaderParams("Content-type") contentType: string) {
34
- return {contentType};
35
- }
36
-
37
- @Get("/scenario-3")
38
- testScenario3(
39
- @HeaderParams({
40
- expression: "x-token",
41
- useValidation: true
42
- })
43
- @Required()
44
- @Enum("test", "gcp")
45
- token: string
46
- ): any {
47
- return {token};
48
- }
49
- }
50
-
51
- export function testHeaderParams(options: PlatformTestingSdkOpts) {
52
- let request: SuperTest.Agent;
53
- beforeAll(
54
- PlatformTest.bootstrap(options.server, {
55
- ...options,
56
- mount: {
57
- "/rest": [HeaderParamsCtrl]
58
- }
59
- })
60
- );
61
- beforeAll(() => {
62
- request = SuperTest(PlatformTest.callback());
63
- });
64
- afterAll(PlatformTest.reset);
65
-
66
- describe("Scenario 1: GET /rest/header-params/scenario-1", () => {
67
- it("should return a response with the extracted authorization from the request headers", async () => {
68
- const {body}: any = await request
69
- .get("/rest/header-params/scenario-1")
70
- .set({
71
- Authorization: "tokenauth"
72
- })
73
- .expect(200);
74
-
75
- expect(body.user).toEqual(1);
76
- expect(body.token).toEqual("tokenauth");
77
- });
78
- });
79
-
80
- describe("Scenario 2: POST with contentType", () => {
81
- it("should return a response with the extracted contentType from the request headers", async () => {
82
- const response = await request
83
- .post("/rest/header-params/scenario-2")
84
- .send({})
85
- .set({
86
- "Content-Type": "application/json"
87
- })
88
- .expect(200);
89
-
90
- expect(response.body).toEqual({
91
- contentType: "application/json"
92
- });
93
- });
94
- });
95
- describe("Scenario3: GET /rest/headers/scenario-3", () => {
96
- it("should accept the header", async () => {
97
- const response = await request.get("/rest/header-params/scenario-3").set("x-token", "test").expect(200);
98
-
99
- expect(response.body).toEqual({
100
- token: "test"
101
- });
102
- });
103
-
104
- it("should not validate the header", async () => {
105
- const response = await request.get("/rest/header-params/scenario-3").expect(400);
106
-
107
- expect(response.body).toEqual({
108
- errors: [
109
- {
110
- requestPath: "header",
111
- dataPath: ".x-token",
112
- keyword: "required",
113
- message: "It should have required parameter 'x-token'",
114
- modelName: "header",
115
- params: {
116
- missingProperty: "x-token"
117
- },
118
- schemaPath: "#/required"
119
- }
120
- ],
121
- message: "Bad request on parameter \"request.header.x-token\".\nIt should have required parameter 'x-token'",
122
- name: "REQUIRED_VALIDATION_ERROR",
123
- status: 400
124
- });
125
- });
126
-
127
- it("should not validate the header - enum", async () => {
128
- const response = await request.get("/rest/header-params/scenario-3").set("x-token", "invalid").expect(400);
129
-
130
- expect(response.body).toEqual({
131
- errors: [
132
- {
133
- data: "invalid",
134
- requestPath: "header",
135
- dataPath: ".x-token",
136
- instancePath: "",
137
- keyword: "enum",
138
- message: "must be equal to one of the allowed values",
139
- params: {
140
- allowedValues: ["test", "gcp"]
141
- },
142
- schemaPath: "#/enum"
143
- }
144
- ],
145
- message:
146
- 'Bad request on parameter "request.header.x-token".\nValue must be equal to one of the allowed values. Given value: "invalid"',
147
- name: "AJV_VALIDATION_ERROR",
148
- status: 400
149
- });
150
- });
151
- });
152
- }
@@ -1,91 +0,0 @@
1
- import {BodyParams, Controller, Get, PlatformResponse, PlatformTest, Res} from "@tsed/common";
2
- import {Returns} from "@tsed/schema";
3
- import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
-
6
- @Controller("/headers")
7
- export class HeadersCtrl {
8
- @Get("/scenario-1")
9
- @Returns(200, String).Header("test", "x-token")
10
- testScenario1(@BodyParams("test") value: string[]): any {
11
- return "hello";
12
- }
13
-
14
- @Get("/scenario-2")
15
- @Returns(200, String).Header("x-token-test", "test").Header("x-token-test-2", "test2").ContentType("application/xml")
16
- testScenario2() {
17
- return "<xml></xml>";
18
- }
19
-
20
- @Get("/scenario-3")
21
- @Returns(200, String).Headers({
22
- Location: {
23
- description: "URL to the new xxx",
24
- type: "string",
25
- value: "/v1/location/header"
26
- }
27
- })
28
- testScenario3(@Res() response: PlatformResponse) {
29
- response.setHeader("Location", `/v1/location`);
30
- return "Hello";
31
- }
32
- }
33
-
34
- export function testHeaders(options: PlatformTestingSdkOpts) {
35
- let request: SuperTest.Agent;
36
-
37
- beforeAll(
38
- PlatformTest.bootstrap(options.server, {
39
- ...options,
40
- logger: {
41
- level: "off"
42
- },
43
- mount: {
44
- "/rest": [HeadersCtrl]
45
- }
46
- })
47
- );
48
- beforeAll(() => {
49
- request = SuperTest(PlatformTest.callback());
50
- });
51
- afterAll(PlatformTest.reset);
52
-
53
- it("Scenario1: GET /rest/headers/scenario-1", async () => {
54
- const response = await request.get("/rest/headers/scenario-1").expect(200);
55
-
56
- expect(response.text).toEqual("hello");
57
- expect(response.header["test"]).toEqual("x-token");
58
- });
59
-
60
- it("Scenario2: GET /rest/headers/scenario-2", (done: Function) => {
61
- request
62
- .get("/rest/headers/scenario-2")
63
- .expect(200)
64
- .end((err: any, response: any) => {
65
- if (err) {
66
- throw err;
67
- }
68
-
69
- expect(response.headers["x-token-test"]).toEqual("test");
70
- expect(response.headers["x-token-test-2"]).toEqual("test2");
71
- expect(response.headers["content-type"]).toContain("application/xml");
72
-
73
- done();
74
- });
75
- });
76
-
77
- it("Scenario3: GET /rest/headers/scenario-3", (done: Function) => {
78
- request
79
- .get("/rest/headers/scenario-3")
80
- .expect(200)
81
- .end((err: any, response: any) => {
82
- if (err) {
83
- throw err;
84
- }
85
-
86
- expect(response.headers["location"]).toEqual("/v1/location");
87
-
88
- done();
89
- });
90
- });
91
- }