(e: any, idKey: IdKey)
| 1571 | describe("toRow strips _etag and id from data", () => { |
| 1572 | // Replicate the toRow logic from SQL.ts to test in isolation |
| 1573 | const toRow = <IdKey extends PropertyKey>(e: any, idKey: IdKey) => { |
| 1574 | const newE = makeETag(e) |
| 1575 | const id = newE[idKey] as string |
| 1576 | const { _etag, [idKey]: _id, ...rest } = newE as any |
| 1577 | const data = JSON.stringify(rest) |
| 1578 | return { id, _etag: newE._etag!, data, item: newE } |
| 1579 | } |
| 1580 | |
| 1581 | it("data JSON does not contain _etag", () => { |
| 1582 | const row = toRow({ id: "1", _etag: undefined, name: "Alice", age: 30 }, "id") |
no test coverage detected
searching dependent graphs…