@agentuity/runtime 0.0.69 → 0.0.71

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 (100) hide show
  1. package/AGENTS.md +88 -10
  2. package/README.md +0 -2
  3. package/dist/_config.d.ts +16 -0
  4. package/dist/_config.d.ts.map +1 -1
  5. package/dist/_config.js +16 -0
  6. package/dist/_config.js.map +1 -1
  7. package/dist/_context.d.ts +17 -15
  8. package/dist/_context.d.ts.map +1 -1
  9. package/dist/_context.js +17 -8
  10. package/dist/_context.js.map +1 -1
  11. package/dist/_server.d.ts.map +1 -1
  12. package/dist/_server.js +44 -21
  13. package/dist/_server.js.map +1 -1
  14. package/dist/_services.d.ts.map +1 -1
  15. package/dist/_services.js +4 -32
  16. package/dist/_services.js.map +1 -1
  17. package/dist/_tokens.d.ts +1 -0
  18. package/dist/_tokens.d.ts.map +1 -1
  19. package/dist/_tokens.js +1 -0
  20. package/dist/_tokens.js.map +1 -1
  21. package/dist/_validation.d.ts +3 -3
  22. package/dist/_validation.d.ts.map +1 -1
  23. package/dist/_validation.js.map +1 -1
  24. package/dist/agent.d.ts +289 -107
  25. package/dist/agent.d.ts.map +1 -1
  26. package/dist/agent.js +206 -149
  27. package/dist/agent.js.map +1 -1
  28. package/dist/app.d.ts +6 -18
  29. package/dist/app.d.ts.map +1 -1
  30. package/dist/app.js +1 -1
  31. package/dist/app.js.map +1 -1
  32. package/dist/eval.d.ts +4 -4
  33. package/dist/eval.d.ts.map +1 -1
  34. package/dist/index.d.ts +2 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/otel/config.d.ts.map +1 -1
  39. package/dist/otel/config.js +5 -2
  40. package/dist/otel/config.js.map +1 -1
  41. package/dist/otel/console.d.ts +10 -6
  42. package/dist/otel/console.d.ts.map +1 -1
  43. package/dist/otel/console.js +31 -13
  44. package/dist/otel/console.js.map +1 -1
  45. package/dist/otel/logger.d.ts.map +1 -1
  46. package/dist/otel/logger.js +0 -19
  47. package/dist/otel/logger.js.map +1 -1
  48. package/dist/otel/otel.d.ts +2 -1
  49. package/dist/otel/otel.d.ts.map +1 -1
  50. package/dist/otel/otel.js +28 -15
  51. package/dist/otel/otel.js.map +1 -1
  52. package/dist/services/local/_db.d.ts.map +1 -1
  53. package/dist/services/local/_db.js +1 -22
  54. package/dist/services/local/_db.js.map +1 -1
  55. package/dist/services/local/_router.d.ts.map +1 -1
  56. package/dist/services/local/_router.js +0 -32
  57. package/dist/services/local/_router.js.map +1 -1
  58. package/dist/services/local/index.d.ts +0 -1
  59. package/dist/services/local/index.d.ts.map +1 -1
  60. package/dist/services/local/index.js +0 -1
  61. package/dist/services/local/index.js.map +1 -1
  62. package/dist/session.d.ts +2 -2
  63. package/dist/validator.d.ts +140 -0
  64. package/dist/validator.d.ts.map +1 -0
  65. package/dist/validator.js +146 -0
  66. package/dist/validator.js.map +1 -0
  67. package/dist/workbench.d.ts.map +1 -1
  68. package/dist/workbench.js +38 -29
  69. package/dist/workbench.js.map +1 -1
  70. package/package.json +7 -6
  71. package/src/_config.ts +19 -0
  72. package/src/_context.ts +25 -31
  73. package/src/_server.ts +49 -22
  74. package/src/_services.ts +2 -31
  75. package/src/_tokens.ts +1 -0
  76. package/src/_validation.ts +3 -7
  77. package/src/agent.ts +555 -348
  78. package/src/app.ts +5 -18
  79. package/src/eval.ts +6 -6
  80. package/src/index.ts +2 -1
  81. package/src/otel/config.ts +5 -2
  82. package/src/otel/console.ts +34 -20
  83. package/src/otel/logger.ts +0 -18
  84. package/src/otel/otel.ts +43 -29
  85. package/src/services/local/_db.ts +1 -27
  86. package/src/services/local/_router.ts +0 -46
  87. package/src/services/local/index.ts +0 -1
  88. package/src/session.ts +2 -2
  89. package/src/validator.ts +277 -0
  90. package/src/workbench.ts +38 -32
  91. package/dist/agent.validator.test.d.ts +0 -2
  92. package/dist/agent.validator.test.d.ts.map +0 -1
  93. package/dist/agent.validator.test.js +0 -508
  94. package/dist/agent.validator.test.js.map +0 -1
  95. package/dist/services/local/objectstore.d.ts +0 -19
  96. package/dist/services/local/objectstore.d.ts.map +0 -1
  97. package/dist/services/local/objectstore.js +0 -117
  98. package/dist/services/local/objectstore.js.map +0 -1
  99. package/src/agent.validator.test.ts +0 -587
  100. package/src/services/local/objectstore.ts +0 -177
@@ -1,587 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /**
3
- * Runtime and compile-time tests for agent.validator()
4
- *
5
- * These tests verify both:
6
- * 1. Runtime validation behavior (expect() assertions)
7
- * 2. Compile-time type inference (inline type annotations)
8
- *
9
- * Type safety is validated by:
10
- * - Using typed variable assignments (e.g., const name: string = data.name)
11
- * - Passing data to functions with specific type signatures
12
- * - If types regress, these tests will fail during `bun run typecheck`
13
- */
14
- import { describe, test, expect } from 'bun:test';
15
- import { Hono } from 'hono';
16
- import { z } from 'zod';
17
- import { createAgent } from './agent';
18
-
19
- describe('agent.validator()', () => {
20
- const testAgent = createAgent({
21
- metadata: { name: 'Test Agent' },
22
- schema: {
23
- input: z.object({ name: z.string(), age: z.number() }),
24
- output: z.string(),
25
- },
26
- handler: async (_ctx, input) => {
27
- return `Hello, ${input.name}! You are ${input.age} years old.`;
28
- },
29
- });
30
-
31
- test('validates input using agent schema', async () => {
32
- const app = new Hono();
33
- app.post('/test', testAgent.validator(), async (c) => {
34
- const data = c.req.valid('json');
35
-
36
- // TYPE ASSERTION: data should be typed as { name: string, age: number }
37
- const name: string = data.name;
38
- const age: number = data.age;
39
- expect(name).toBe('Alice');
40
- expect(age).toBe(30);
41
-
42
- return c.json(`${data.name}-${data.age}`);
43
- });
44
-
45
- const validRes = await app.request('/test', {
46
- method: 'POST',
47
- headers: { 'Content-Type': 'application/json' },
48
- body: JSON.stringify({ name: 'Alice', age: 30 }),
49
- });
50
- expect(validRes.status).toBe(200);
51
- const validData: any = await validRes.json();
52
- expect(validData).toBe('Alice-30');
53
- });
54
-
55
- test('returns 400 on input validation failure', async () => {
56
- const app = new Hono();
57
- app.post('/test', testAgent.validator(), async (c) => {
58
- const data = c.req.valid('json');
59
- return c.json(`${data.name}-${data.age}`);
60
- });
61
-
62
- const res = await app.request('/test', {
63
- method: 'POST',
64
- headers: { 'Content-Type': 'application/json' },
65
- body: JSON.stringify({ name: 'Bob' }),
66
- });
67
- expect(res.status).toBe(400);
68
- const error: any = await res.json();
69
- expect(error).toHaveProperty('error', 'Validation failed');
70
- expect(error).toHaveProperty('issues');
71
- expect(Array.isArray(error.issues)).toBe(true);
72
- });
73
-
74
- test('overrides input schema', async () => {
75
- const customSchema = z.object({
76
- email: z.string().email(),
77
- count: z.number().min(1),
78
- });
79
-
80
- const app = new Hono();
81
- app.post('/test', testAgent.validator({ input: customSchema }), async (c) => {
82
- const data = c.req.valid('json');
83
-
84
- // TYPE ASSERTION: data should be typed from CUSTOM schema, not agent schema
85
- const email: string = data.email;
86
- const count: number = data.count;
87
- expect(email).toBeDefined();
88
- expect(count).toBeGreaterThan(0);
89
-
90
- return c.text('ok');
91
- });
92
-
93
- const validRes = await app.request('/test', {
94
- method: 'POST',
95
- headers: { 'Content-Type': 'application/json' },
96
- body: JSON.stringify({ email: 'test@example.com', count: 5 }),
97
- });
98
- expect(validRes.status).toBe(200);
99
-
100
- const invalidRes = await app.request('/test', {
101
- method: 'POST',
102
- headers: { 'Content-Type': 'application/json' },
103
- body: JSON.stringify({ email: 'invalid', count: 5 }),
104
- });
105
- expect(invalidRes.status).toBe(400);
106
- });
107
-
108
- test('supports middleware chaining', async () => {
109
- const app = new Hono();
110
-
111
- const testMiddleware = async (c: any, next: () => Promise<void>) => {
112
- (c as any).set('middlewareRan', true);
113
- await next();
114
- };
115
-
116
- app.post('/test', testAgent.validator(), testMiddleware, async (c) => {
117
- const data = c.req.valid('json');
118
- const middlewareRan = (c as any).get('middlewareRan');
119
- expect(middlewareRan).toBe(true);
120
- return c.json(`${data.name}-${data.age}`);
121
- });
122
-
123
- const res = await app.request('/test', {
124
- method: 'POST',
125
- headers: { 'Content-Type': 'application/json' },
126
- body: JSON.stringify({ name: 'Dave', age: 40 }),
127
- });
128
- expect(res.status).toBe(200);
129
- const result: any = await res.json();
130
- expect(result).toBe('Dave-40');
131
- });
132
-
133
- test('validates multiple fields with detailed errors', async () => {
134
- const complexSchema = z.object({
135
- email: z.string().email(),
136
- age: z.number().min(18).max(100),
137
- username: z.string().min(3).max(20),
138
- });
139
-
140
- const complexAgent = createAgent({
141
- metadata: { name: 'Complex' },
142
- schema: {
143
- input: complexSchema,
144
- output: z.string(),
145
- },
146
- handler: async () => 'ok',
147
- });
148
-
149
- const app = new Hono();
150
- app.post('/test', complexAgent.validator(), async (c) => {
151
- return c.text('ok');
152
- });
153
-
154
- const res = await app.request('/test', {
155
- method: 'POST',
156
- headers: { 'Content-Type': 'application/json' },
157
- body: JSON.stringify({
158
- email: 'invalid-email',
159
- age: 15,
160
- username: 'ab',
161
- }),
162
- });
163
- expect(res.status).toBe(400);
164
- const error: any = await res.json();
165
- expect(error.issues.length).toBeGreaterThan(0);
166
- });
167
-
168
- test('handles nested object validation', async () => {
169
- const nestedAgent = createAgent({
170
- metadata: { name: 'Nested' },
171
- schema: {
172
- input: z.object({
173
- user: z.object({
174
- name: z.string(),
175
- address: z.object({
176
- city: z.string(),
177
- zip: z.string(),
178
- }),
179
- }),
180
- }),
181
- output: z.string(),
182
- },
183
- handler: async () => 'ok',
184
- });
185
-
186
- const app = new Hono();
187
- app.post('/test', nestedAgent.validator(), async (c) => {
188
- const _data = c.req.valid('json');
189
- return c.text('ok');
190
- });
191
-
192
- const validRes = await app.request('/test', {
193
- method: 'POST',
194
- headers: { 'Content-Type': 'application/json' },
195
- body: JSON.stringify({
196
- user: {
197
- name: 'Alice',
198
- address: { city: 'NYC', zip: '10001' },
199
- },
200
- }),
201
- });
202
- expect(validRes.status).toBe(200);
203
-
204
- const invalidRes = await app.request('/test', {
205
- method: 'POST',
206
- headers: { 'Content-Type': 'application/json' },
207
- body: JSON.stringify({
208
- user: {
209
- name: 'Bob',
210
- address: { zip: '10001' },
211
- },
212
- }),
213
- });
214
- expect(invalidRes.status).toBe(400);
215
- const error: any = await invalidRes.json();
216
- expect(error.message).toContain('city');
217
- });
218
-
219
- test('validates arrays in input', async () => {
220
- const arrayAgent = createAgent({
221
- metadata: { name: 'Array Agent' },
222
- schema: {
223
- input: z.object({
224
- items: z.array(z.string()),
225
- count: z.number(),
226
- }),
227
- output: z.number(),
228
- },
229
- handler: async (_ctx, input) => input.items.length,
230
- });
231
-
232
- const app = new Hono();
233
- app.post('/test', arrayAgent.validator(), async (c) => {
234
- const data = c.req.valid('json');
235
- return c.json(data.items.length);
236
- });
237
-
238
- const res = await app.request('/test', {
239
- method: 'POST',
240
- headers: { 'Content-Type': 'application/json' },
241
- body: JSON.stringify({ items: ['a', 'b', 'c'], count: 3 }),
242
- });
243
- expect(res.status).toBe(200);
244
- const result: any = await res.json();
245
- expect(result).toBe(3);
246
- });
247
-
248
- test('agent with input-only schema (no output)', async () => {
249
- // Agent with input but NO output schema
250
- // Handler should be constrained to return void/undefined
251
- const inputOnlyAgent = createAgent({
252
- metadata: { name: 'Input Only' },
253
- schema: {
254
- input: z.string(),
255
- // NO output schema
256
- },
257
- handler: async (_ctx, input) => {
258
- // Handler must return void when no output schema
259
- console.log(`Received: ${input}`);
260
- return undefined;
261
- },
262
- });
263
-
264
- const app = new Hono();
265
- app.post('/test', inputOnlyAgent.validator(), async (c) => {
266
- const data = c.req.valid('json');
267
-
268
- // TYPE ASSERTION: data should be typed as string (the input schema)
269
- const input: string = data;
270
- expect(input).toBe('test-input');
271
-
272
- return c.text('processed');
273
- });
274
-
275
- const res = await app.request('/test', {
276
- method: 'POST',
277
- headers: { 'Content-Type': 'application/json' },
278
- body: JSON.stringify('test-input'),
279
- });
280
- expect(res.status).toBe(200);
281
- });
282
-
283
- test('handles streaming agent without output schema', async () => {
284
- const streamAgent = createAgent({
285
- metadata: { name: 'Stream Agent' },
286
- schema: {
287
- input: z.object({ message: z.string() }),
288
- stream: true,
289
- },
290
- handler: async (_ctx, input) => {
291
- return new ReadableStream({
292
- start(controller) {
293
- controller.enqueue(`Message: ${input.message}`);
294
- controller.close();
295
- },
296
- });
297
- },
298
- });
299
-
300
- const app = new Hono();
301
- app.post('/test', streamAgent.validator(), async (c) => {
302
- const data = c.req.valid('json');
303
-
304
- // TYPE ASSERTION: data should have 'message' property typed as string
305
- const msg: string = data.message;
306
- expect(msg).toBe('test');
307
-
308
- // TYPE ASSERTION: Should be able to pass to function expecting the type
309
- const validate = (input: { message: string }) => input.message;
310
- expect(validate(data)).toBe('test');
311
-
312
- return c.text('ok');
313
- });
314
-
315
- const res = await app.request('/test', {
316
- method: 'POST',
317
- headers: { 'Content-Type': 'application/json' },
318
- body: JSON.stringify({ message: 'test' }),
319
- });
320
- expect(res.status).toBe(200);
321
- });
322
-
323
- test('middleware before validator can modify context', async () => {
324
- const app = new Hono();
325
-
326
- const authMiddleware = async (c: any, next: () => Promise<void>) => {
327
- c.set('userId', 'user-123');
328
- c.set('authenticated', true);
329
- await next();
330
- };
331
-
332
- app.post('/test', authMiddleware, testAgent.validator(), async (c) => {
333
- const data = c.req.valid('json');
334
- const userId = (c as any).get('userId');
335
- const authenticated = (c as any).get('authenticated');
336
-
337
- expect(userId).toBe('user-123');
338
- expect(authenticated).toBe(true);
339
-
340
- return c.json(`${data.name}-${data.age}`);
341
- });
342
-
343
- const res = await app.request('/test', {
344
- method: 'POST',
345
- headers: { 'Content-Type': 'application/json' },
346
- body: JSON.stringify({ name: 'Eve', age: 35 }),
347
- });
348
- expect(res.status).toBe(200);
349
- const result: any = await res.json();
350
- expect(result).toBe('Eve-35');
351
- });
352
-
353
- test('middleware after validator receives validated data', async () => {
354
- const app = new Hono();
355
-
356
- const loggingMiddleware = async (c: any, next: () => Promise<void>) => {
357
- const data = c.req.valid('json');
358
- c.set('loggedName', data.name);
359
- await next();
360
- };
361
-
362
- app.post('/test', testAgent.validator(), loggingMiddleware, async (c) => {
363
- const data = c.req.valid('json');
364
- const loggedName = (c as any).get('loggedName');
365
-
366
- expect(loggedName).toBe(data.name);
367
- return c.json(`${data.name}-${data.age}`);
368
- });
369
-
370
- const res = await app.request('/test', {
371
- method: 'POST',
372
- headers: { 'Content-Type': 'application/json' },
373
- body: JSON.stringify({ name: 'Frank', age: 45 }),
374
- });
375
- expect(res.status).toBe(200);
376
- });
377
-
378
- test('multiple middleware with validator in chain', async () => {
379
- const app = new Hono();
380
-
381
- const middleware1 = async (c: any, next: () => Promise<void>) => {
382
- c.set('step1', true);
383
- await next();
384
- };
385
-
386
- const middleware2 = async (c: any, next: () => Promise<void>) => {
387
- c.set('step2', true);
388
- await next();
389
- };
390
-
391
- const middleware3 = async (c: any, next: () => Promise<void>) => {
392
- c.set('step3', true);
393
- await next();
394
- };
395
-
396
- app.post('/test', middleware1, testAgent.validator(), middleware2, middleware3, async (c) => {
397
- const data = c.req.valid('json');
398
- expect((c as any).get('step1')).toBe(true);
399
- expect((c as any).get('step2')).toBe(true);
400
- expect((c as any).get('step3')).toBe(true);
401
- return c.json(`${data.name}-${data.age}`);
402
- });
403
-
404
- const res = await app.request('/test', {
405
- method: 'POST',
406
- headers: { 'Content-Type': 'application/json' },
407
- body: JSON.stringify({ name: 'Test', age: 30 }),
408
- });
409
- expect(res.status).toBe(200);
410
- const result: any = await res.json();
411
- expect(result).toBe('Test-30');
412
- });
413
-
414
- test('validation fails before subsequent middleware runs', async () => {
415
- const app = new Hono();
416
-
417
- let middlewareRan = false;
418
-
419
- const afterValidationMiddleware = async (c: any, next: () => Promise<void>) => {
420
- middlewareRan = true;
421
- await next();
422
- };
423
-
424
- app.post('/test', testAgent.validator(), afterValidationMiddleware, async (c) => {
425
- return c.text('ok');
426
- });
427
-
428
- // Invalid request - middleware should NOT run
429
- middlewareRan = false;
430
- await app.request('/test', {
431
- method: 'POST',
432
- headers: { 'Content-Type': 'application/json' },
433
- body: JSON.stringify({ invalid: 'data' }),
434
- });
435
-
436
- expect(middlewareRan).toBe(false);
437
- });
438
-
439
- test('middleware can short-circuit before validator', async () => {
440
- const app = new Hono();
441
-
442
- const blockMiddleware = async (c: any, next: () => Promise<void>) => {
443
- const body = await c.req.json();
444
- if (body.blocked) {
445
- return c.json({ error: 'Blocked by middleware' }, 403);
446
- }
447
- await next();
448
- };
449
-
450
- app.post('/test', blockMiddleware, testAgent.validator(), async (c) => {
451
- const data = c.req.valid('json');
452
- return c.json(`${data.name}-${data.age}`);
453
- });
454
-
455
- // Blocked request returns 403, validation never runs
456
- const blockedRes = await app.request('/test', {
457
- method: 'POST',
458
- headers: { 'Content-Type': 'application/json' },
459
- body: JSON.stringify({ name: 'Test', age: 30, blocked: true }),
460
- });
461
- expect(blockedRes.status).toBe(403);
462
-
463
- // Non-blocked request validates normally
464
- const allowedRes = await app.request('/test', {
465
- method: 'POST',
466
- headers: { 'Content-Type': 'application/json' },
467
- body: JSON.stringify({ name: 'Test', age: 30 }),
468
- });
469
- expect(allowedRes.status).toBe(200);
470
- });
471
- });
472
-
473
- describe('agent.validator() - output validation', () => {
474
- test('validates output against agent schema', async () => {
475
- const agent = createAgent({
476
- metadata: { name: 'Output Test' },
477
- schema: {
478
- input: z.object({ value: z.number() }),
479
- output: z.object({ result: z.number() }),
480
- },
481
- handler: async (_ctx, input) => ({ result: input.value * 2 }),
482
- });
483
-
484
- const app = new Hono();
485
- app.post('/test', agent.validator(), async (c) => {
486
- const data = c.req.valid('json');
487
- // Return properly formatted output matching the schema
488
- return c.json({ result: data.value * 2 });
489
- });
490
-
491
- const res = await app.request('/test', {
492
- method: 'POST',
493
- headers: { 'Content-Type': 'application/json' },
494
- body: JSON.stringify({ value: 5 }),
495
- });
496
- expect(res.status).toBe(200);
497
- const result: any = await res.json();
498
- expect(result).toEqual({ result: 10 });
499
- });
500
-
501
- test('throws 500 on output validation failure', async () => {
502
- const agent = createAgent({
503
- metadata: { name: 'Bad Output' },
504
- schema: {
505
- input: z.object({ value: z.number() }),
506
- output: z.object({ result: z.number() }),
507
- },
508
- handler: async () => ({ result: 5 }),
509
- });
510
-
511
- const app = new Hono();
512
- app.post('/test', agent.validator(), async (c) => {
513
- // Handler returns wrong type - should cause output validation error
514
- return c.json({ wrong: 'type' });
515
- });
516
-
517
- const res = await app.request('/test', {
518
- method: 'POST',
519
- headers: { 'Content-Type': 'application/json' },
520
- body: JSON.stringify({ value: 5 }),
521
- });
522
- expect(res.status).toBe(500);
523
- });
524
-
525
- test('output validation with override schema', async () => {
526
- const agent = createAgent({
527
- metadata: { name: 'Override Output' },
528
- schema: {
529
- input: z.object({ x: z.number() }),
530
- output: z.string(),
531
- },
532
- handler: async () => 'default',
533
- });
534
-
535
- const customOutput = z.object({ count: z.number() });
536
-
537
- const app = new Hono();
538
- app.post('/test', agent.validator({ output: customOutput }), async (c) => {
539
- return c.json({ count: 42 });
540
- });
541
-
542
- const res = await app.request('/test', {
543
- method: 'POST',
544
- headers: { 'Content-Type': 'application/json' },
545
- body: JSON.stringify({ x: 1 }),
546
- });
547
- expect(res.status).toBe(200);
548
- const result: any = await res.json();
549
- expect(result).toEqual({ count: 42 });
550
- });
551
- });
552
-
553
- test('skips output validation for streaming agents', async () => {
554
- const streamingAgent = createAgent({
555
- metadata: { name: 'Streaming' },
556
- schema: {
557
- input: z.object({ data: z.string() }),
558
- output: z.string(),
559
- stream: true,
560
- },
561
- handler: async (_ctx, input) => {
562
- return new ReadableStream({
563
- start(controller) {
564
- controller.enqueue(input.data);
565
- controller.close();
566
- },
567
- });
568
- },
569
- });
570
-
571
- const app = new Hono();
572
- app.post('/test', streamingAgent.validator(), async (c) => {
573
- const data = c.req.valid('json');
574
- // Return any JSON - output validation should be skipped for streams
575
- return c.json({ stream: 'response', data: data.data });
576
- });
577
-
578
- const res = await app.request('/test', {
579
- method: 'POST',
580
- headers: { 'Content-Type': 'application/json' },
581
- body: JSON.stringify({ data: 'test' }),
582
- });
583
- // Should succeed even though output doesn't match schema (stream validation skipped)
584
- expect(res.status).toBe(200);
585
- const result: any = await res.json();
586
- expect(result.data).toBe('test');
587
- });