(items: unknown[])
| 26 | }) |
| 27 | |
| 28 | function createManifest(items: unknown[]) { |
| 29 | const json = JSON.stringify(items) |
| 30 | const size = Buffer.byteLength(json, 'utf8') |
| 31 | const id = 'lv_ABCDEFGHIJKL' |
| 32 | cacheLargeValue(id, items, size, fakeCtx) |
| 33 | |
| 34 | return { |
| 35 | __simLargeArrayManifest: true, |
| 36 | version: LARGE_ARRAY_MANIFEST_VERSION, |
| 37 | kind: 'array', |
| 38 | totalCount: items.length, |
| 39 | chunkCount: 1, |
| 40 | byteSize: size, |
| 41 | chunks: [ |
| 42 | { |
| 43 | ref: { |
| 44 | __simLargeValueRef: true, |
| 45 | version: 1, |
| 46 | id, |
| 47 | kind: 'array', |
| 48 | size, |
| 49 | executionId: fakeCtx.executionId, |
| 50 | }, |
| 51 | count: items.length, |
| 52 | byteSize: size, |
| 53 | }, |
| 54 | ], |
| 55 | preview: items.slice(0, 3), |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | it('returns arrays as-is', async () => { |
| 60 | await expect(resolveArrayInputAsync(fakeCtx, [1, 2, 3], null)).resolves.toEqual([1, 2, 3]) |
no test coverage detected