@tsed/platform-test-sdk 7.79.3 → 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,279 +0,0 @@
1
- import {Controller, Get, Head, Inject, PathParams, PlatformTest, Post, QueryParams} from "@tsed/common";
2
- import {UseCache, PlatformCache} from "@tsed/platform-cache";
3
- import {Property} from "@tsed/schema";
4
- import SuperTest from "supertest";
5
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
6
-
7
- let increment = 0;
8
-
9
- export function testCache(options: PlatformTestingSdkOpts) {
10
- let request: SuperTest.Agent;
11
-
12
- class MyModel {
13
- @Property()
14
- name: string;
15
- }
16
-
17
- class MyService {
18
- @UseCache({
19
- key: "key"
20
- })
21
- get(id: string) {
22
- return {id: `one:${id}`};
23
- }
24
-
25
- @UseCache({
26
- key(args: any[]) {
27
- return `key:${args[0]}`;
28
- }
29
- })
30
- get2(id: string) {
31
- return {id: `one:${id}`};
32
- }
33
- }
34
-
35
- @Controller("/caches")
36
- class TestCacheController {
37
- @Inject()
38
- myService: MyService;
39
-
40
- @Get("/scenario-1")
41
- @UseCache()
42
- scenario1() {
43
- increment++;
44
- return "hello world " + increment;
45
- }
46
-
47
- @Get("/scenario-2")
48
- @UseCache({ttl: 400})
49
- scenario2() {
50
- return {info: "hello child"};
51
- }
52
-
53
- @Head("/scenario-3")
54
- @UseCache()
55
- scenario3() {
56
- return undefined;
57
- }
58
-
59
- @Post("/scenario-4")
60
- @UseCache()
61
- scenario4() {
62
- return {info: "hello child"};
63
- }
64
-
65
- @Get("/scenario-5/:id")
66
- @UseCache({ttl: 400})
67
- scenario5(@PathParams("id") id: string, @QueryParams() model: MyModel) {
68
- return {info: "hello child", id, ...model};
69
- }
70
-
71
- @Get("/scenario-6/:id")
72
- scenario6(@PathParams("id") id: string) {
73
- return this.myService.get(id);
74
- }
75
-
76
- @Get("/scenario-7/:id")
77
- scenario7(@PathParams("id") id: string) {
78
- return this.myService.get2(id);
79
- }
80
- }
81
-
82
- describe("withCache", () => {
83
- beforeEach(
84
- PlatformTest.bootstrap(options.server, {
85
- ...options,
86
- logger: {},
87
- mount: {
88
- "/rest": [TestCacheController]
89
- },
90
- cache: {
91
- ttl: 300,
92
- store: "memory"
93
- }
94
- })
95
- );
96
- beforeEach(() => {
97
- request = SuperTest(PlatformTest.callback());
98
- });
99
- afterEach(PlatformTest.reset);
100
-
101
- describe("scenario 1: GET /rest/caches/scenario-1", () => {
102
- it("should return data with cached response", async () => {
103
- const response = await request.get("/rest/caches/scenario-1").expect(200);
104
- const response2 = await request.get("/rest/caches/scenario-1").expect(200);
105
-
106
- expect(response.text).toContain("hello world");
107
- expect(response.headers["cache-control"]).toMatch(/max-age=300/);
108
- expect(response.headers["x-cached"]).toBeUndefined();
109
-
110
- expect(response2.text).toContain("hello world");
111
- expect(response2.headers["cache-control"]).toMatch(/max-age=300/);
112
- expect(response2.headers["x-cached"]).toEqual("true");
113
- expect(response2.headers["etag"]).toEqual(response.headers["etag"]);
114
- });
115
-
116
- it("should return 304 when content isn't modified", async () => {
117
- const platformCache = PlatformTest.get<PlatformCache>(PlatformCache);
118
-
119
- const response = await request.get("/rest/caches/scenario-1").expect(200);
120
-
121
- if (response.headers["etag"]) {
122
- // platform koa doesn't support Etag
123
- await request
124
- .get("/rest/caches/scenario-1")
125
- .set("if-none-match", response.headers["etag"] || "")
126
- .expect(304);
127
-
128
- await platformCache.reset();
129
-
130
- await request
131
- .get("/rest/caches/scenario-1")
132
- .set("if-none-match", response.headers["etag"] || "")
133
- .expect(200);
134
- }
135
- });
136
-
137
- it("should return fresh data if cache-control is set to no-cache", async () => {
138
- await request.get("/rest/caches/scenario-1").expect(200);
139
- const response2 = await request.get("/rest/caches/scenario-1").set("cache-control", "no-cache").expect(200);
140
-
141
- expect(response2.text).toContain("hello world");
142
- expect(response2.headers["cache-control"]).toMatch(/max-age=300/);
143
- expect(response2.headers["x-cached"]).toBeUndefined();
144
- expect(response2.headers["etag"]).toEqual(response2.headers["etag"]);
145
- });
146
- });
147
- describe("scenario 2: GET /rest/caches/scenario-2", () => {
148
- it("should return data with cached response", async () => {
149
- const response = await request.get("/rest/caches/scenario-2").expect(200);
150
- const response2 = await request.get("/rest/caches/scenario-2").expect(200);
151
-
152
- expect(response.body).toEqual({info: "hello child"});
153
- expect(response.headers["cache-control"]).toMatch(/max-age=400/);
154
- expect(response.headers["x-cached"]).toBeUndefined();
155
-
156
- expect(response2.body).toEqual({info: "hello child"});
157
- expect(response2.headers["cache-control"]).toMatch(/max-age=400/);
158
- expect(response2.headers["x-cached"]).toEqual("true");
159
- expect(response2.headers["etag"]).toEqual(response.headers["etag"]);
160
- });
161
- });
162
- describe("scenario 4: POST /rest/caches/scenario-4", () => {
163
- it("should not cache POST method", async () => {
164
- const response = await request.post("/rest/caches/scenario-4").expect(200);
165
- const response2 = await request.post("/rest/caches/scenario-4").expect(200);
166
-
167
- expect(response.body).toEqual({
168
- info: "hello child"
169
- });
170
- expect(response.headers["cache-control"]).toBeUndefined();
171
- expect(response.headers["x-cached"]).toBeUndefined();
172
-
173
- expect(response2.body).toEqual({
174
- info: "hello child"
175
- });
176
- expect(response.headers["cache-control"]).toBeUndefined();
177
- expect(response2.headers["x-cached"]).toBeUndefined();
178
- expect(response2.headers["etag"]).toEqual(response.headers["etag"]);
179
- });
180
- });
181
- describe("scenario 5: GET /rest/caches/scenario-5", () => {
182
- it("should return data with then cache response", async () => {
183
- const response = await request.get("/rest/caches/scenario-5/1?name=1").expect(200);
184
- const response2 = await request.get("/rest/caches/scenario-5/1?name=1").expect(200);
185
- const response3 = await request.get("/rest/caches/scenario-5/2?name=2").expect(200);
186
- const response4 = await request.get("/rest/caches/scenario-5/2?name=2").expect(200);
187
- const response5 = await request.get("/rest/caches/scenario-5/2?name=3").expect(200);
188
-
189
- expect(response.body).toEqual({
190
- id: "1",
191
- info: "hello child",
192
- name: "1"
193
- });
194
- expect(response2.body).toEqual({
195
- id: "1",
196
- info: "hello child",
197
- name: "1"
198
- });
199
- expect(response.headers["x-cached"]).toBeUndefined();
200
- expect(response2.headers["x-cached"]).toEqual("true");
201
- expect(response.body).toEqual(response2.body);
202
-
203
- expect(response3.body).toEqual({
204
- id: "2",
205
- info: "hello child",
206
- name: "2"
207
- });
208
- expect(response4.body).toEqual({
209
- id: "2",
210
- info: "hello child",
211
- name: "2"
212
- });
213
- expect(response3.headers["x-cached"]).toBeUndefined();
214
- expect(response4.headers["x-cached"]).toEqual("true");
215
- expect(response3.body).toEqual(response4.body);
216
-
217
- expect(response2.body).not.toEqual(response4);
218
- expect(response5.body).not.toEqual(response4);
219
- });
220
- });
221
- describe("scenario 6: GET /rest/caches/scenario-6", () => {
222
- it("should return data from cached service", async () => {
223
- const response = await request.get("/rest/caches/scenario-6/1").expect(200);
224
- const response2 = await request.get("/rest/caches/scenario-6/2").expect(200);
225
-
226
- expect(response.body).toEqual({id: "one:1"});
227
- expect(response2.body).toEqual({id: "one:1"});
228
- expect(response.headers["x-cached"]).toBeUndefined();
229
- expect(response2.headers["x-cached"]).toBeUndefined();
230
- expect(response.body).toEqual(response2.body);
231
- });
232
- });
233
- describe("scenario 7: GET /rest/caches/scenario-7", () => {
234
- it("should return data from cached service", async () => {
235
- const response = await request.get("/rest/caches/scenario-7/1").expect(200);
236
- const response2 = await request.get("/rest/caches/scenario-7/2").expect(200);
237
- const response3 = await request.get("/rest/caches/scenario-7/2").expect(200);
238
-
239
- expect(response.body).toEqual({id: "one:1"});
240
- expect(response2.body).toEqual({
241
- id: "one:2"
242
- });
243
- expect(response3.body).toEqual({
244
- id: "one:2"
245
- });
246
- expect(response.body).not.toEqual(response2.body);
247
- });
248
- });
249
- });
250
- describe("withoutCache", () => {
251
- beforeEach(
252
- PlatformTest.bootstrap(options.server, {
253
- ...options,
254
- logger: {},
255
- cache: false,
256
- mount: {
257
- "/rest": [TestCacheController]
258
- }
259
- })
260
- );
261
- beforeEach(() => {
262
- request = SuperTest(PlatformTest.callback());
263
- });
264
- afterEach(PlatformTest.reset);
265
-
266
- describe("scenario 1: GET /rest/caches/scenario-1", () => {
267
- it("should return data with cached response", async () => {
268
- const response = await request.get("/rest/caches/scenario-1").expect(200);
269
- const response2 = await request.get("/rest/caches/scenario-1").expect(200);
270
-
271
- expect(response.text).toContain("hello world");
272
- expect(response.headers["x-cached"]).toBeUndefined();
273
-
274
- expect(response2.text).toContain("hello world");
275
- expect(response2.headers["x-cached"]).toBeUndefined();
276
- });
277
- });
278
- });
279
- }
@@ -1,55 +0,0 @@
1
- import {Controller, Get, PlatformTest} from "@tsed/common";
2
- import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
-
5
- export function testChildrenControllers(options: PlatformTestingSdkOpts) {
6
- let request: SuperTest.Agent;
7
-
8
- @Controller("/children")
9
- class TestChildController {
10
- @Get("/scenario-2")
11
- get() {
12
- return "hello child";
13
- }
14
- }
15
-
16
- @Controller({
17
- path: "/controllers",
18
- children: [TestChildController]
19
- })
20
- class TestController {
21
- @Get("/scenario-1")
22
- scenario1() {
23
- return "hello world";
24
- }
25
- }
26
-
27
- beforeEach(
28
- PlatformTest.bootstrap(options.server, {
29
- ...options,
30
- mount: {
31
- "/rest": [TestController]
32
- }
33
- })
34
- );
35
- beforeEach(() => {
36
- request = SuperTest(PlatformTest.callback());
37
- });
38
- afterEach(PlatformTest.reset);
39
-
40
- describe("scenario 1: GET /rest/controllers/scenario-1", () => {
41
- it("should return a response from method", async () => {
42
- const response = await request.get("/rest/controllers/scenario-1").expect(200);
43
-
44
- expect(response.text).toEqual("hello world");
45
- });
46
- });
47
-
48
- describe("scenario 2: GET /rest/controllers/children/scenario-2", () => {
49
- it("should return a response from method", async () => {
50
- const response = await request.get("/rest/controllers/children/scenario-2").expect(200);
51
-
52
- expect(response.text).toEqual("hello child");
53
- });
54
- });
55
- }
@@ -1,36 +0,0 @@
1
- import {Controller, CookiesParams, Get, PlatformTest} from "@tsed/common";
2
- import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
-
5
- @Controller("/cookies")
6
- export class CookiesCtrl {
7
- /**
8
- * Handle request and get auth from cookies
9
- * @param authorization
10
- */
11
- @Get("/scenario-1")
12
- public scenario1(@CookiesParams("authorization") authorization: string) {
13
- return {authorization};
14
- }
15
- }
16
-
17
- export function testCookies(options: PlatformTestingSdkOpts) {
18
- let request: SuperTest.Agent;
19
- beforeAll(
20
- PlatformTest.bootstrap(options.server, {
21
- ...options,
22
- mount: {
23
- "/rest": [CookiesCtrl]
24
- }
25
- })
26
- );
27
- beforeAll(() => {
28
- request = SuperTest(PlatformTest.callback());
29
- });
30
- afterAll(PlatformTest.reset);
31
- it("Scenario 1: GET /rest/cookies/scenario-1", async () => {
32
- const {body} = await request.get("/rest/cookies/scenario-1").set("Cookie", "authorization=eOIjdkk").expect(200);
33
-
34
- expect(body.authorization).toEqual("eOIjdkk");
35
- });
36
- }
@@ -1,33 +0,0 @@
1
- import {PlatformTest} from "@tsed/common";
2
- import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
-
5
- export function testCustom404(options: PlatformTestingSdkOpts) {
6
- class CustomServer extends options.server {}
7
-
8
- let request: SuperTest.Agent;
9
- beforeAll(
10
- PlatformTest.bootstrap(CustomServer, {
11
- ...options,
12
- mount: {
13
- "/rest": []
14
- }
15
- })
16
- );
17
-
18
- beforeAll(() => {
19
- request = SuperTest(PlatformTest.callback());
20
- });
21
- afterAll(PlatformTest.reset);
22
-
23
- it("Scenario 1: GET /", async () => {
24
- const response: any = await request.get("/").expect(404);
25
-
26
- expect(response.body).toEqual({
27
- name: "NOT_FOUND",
28
- message: 'Resource "/" not found',
29
- status: 404,
30
- errors: []
31
- });
32
- });
33
- }
@@ -1,120 +0,0 @@
1
- import "@tsed/ajv";
2
- import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common";
3
- import {Default, GenericOf, Generics, Maximum, Minimum, Property, Required} from "@tsed/schema";
4
- import SuperTest from "supertest";
5
- import {PlatformTestingSdkOpts} from "../interfaces/index.js";
6
-
7
- class FindQuery {
8
- @Property()
9
- a?: number;
10
-
11
- @Property()
12
- b?: number;
13
- }
14
-
15
- @Generics("T")
16
- class PaginationQuery<T> {
17
- // things about pagination
18
- @Minimum(0)
19
- @Default(0)
20
- offset?: number;
21
-
22
- @Minimum(1)
23
- @Maximum(1000)
24
- @Default(50)
25
- limit?: number;
26
-
27
- @Property("T")
28
- where?: T;
29
- }
30
-
31
- @Controller("/deep-query-params")
32
- class TestDeepQueryParamsCtrl {
33
- @Get("/scenario-1")
34
- testScenario6(@QueryParams() @GenericOf(FindQuery) q: PaginationQuery<FindQuery>, @QueryParams() qs: any) {
35
- return {q};
36
- }
37
-
38
- @Get("/scenario-2")
39
- testScenario7(@QueryParams("q") @GenericOf(FindQuery) q: PaginationQuery<FindQuery>) {
40
- return {q};
41
- }
42
- }
43
-
44
- export function testDeepQueryParams(options: PlatformTestingSdkOpts) {
45
- let request: SuperTest.Agent;
46
-
47
- beforeAll(
48
- PlatformTest.bootstrap(options.server, {
49
- ...options,
50
- ajv: {
51
- verbose: false
52
- },
53
- mount: {
54
- "/rest": [TestDeepQueryParamsCtrl]
55
- }
56
- })
57
- );
58
- beforeAll(() => {
59
- request = SuperTest(PlatformTest.callback());
60
- });
61
- afterAll(PlatformTest.reset);
62
- describe("Scenario1: DeepObject", () => {
63
- const endpoint = "/rest/deep-query-params/scenario-1";
64
- it("should return 0 when query is 0", async () => {
65
- const response = await request.get(`${endpoint}?offset=0&limit=10&where[a]=0&where[b]=1`).expect(200);
66
-
67
- expect(response.body).toEqual({
68
- q: {
69
- limit: 10,
70
- offset: 0,
71
- where: {
72
- a: 0,
73
- b: 1
74
- }
75
- }
76
- });
77
- });
78
- });
79
- describe("Scenario2: DeepObject", () => {
80
- const endpoint = "/rest/deep-query-params/scenario-2";
81
- it("should return the query value", async () => {
82
- const response = await request.get(`${endpoint}?q[offset]=0&q[limit]=10&q[where][a]=0&q[where][b]=1`).expect(200);
83
-
84
- expect(response.body).toEqual({
85
- q: {
86
- limit: 10,
87
- offset: 0,
88
- where: {
89
- a: 0,
90
- b: 1
91
- }
92
- }
93
- });
94
- });
95
- it("should throw a bad request", async () => {
96
- const response = await request.get(`${endpoint}?q[offset]=0&q[limit]=10&q[where][a]=ca&q[where][b]=1`).expect(400);
97
-
98
- expect(response.body).toEqual({
99
- errors: [
100
- {
101
- requestPath: "query",
102
- data: "ca",
103
- dataPath: ".where.a",
104
- instancePath: "/where/a",
105
- keyword: "type",
106
- message: "must be number",
107
- modelName: "PaginationQuery",
108
- params: {
109
- type: "number"
110
- },
111
- schemaPath: "#/properties/where/properties/a/type"
112
- }
113
- ],
114
- message: 'Bad request on parameter "request.query.q".\nPaginationQuery.where.a must be number. Given value: "ca"',
115
- name: "AJV_VALIDATION_ERROR",
116
- status: 400
117
- });
118
- });
119
- });
120
- }