({ transaction })
| 326 | }) |
| 327 | |
| 328 | const mutationFn: MutationFn = ({ transaction }) => { |
| 329 | // Redact time-based and random fields |
| 330 | const redactedTransaction = { |
| 331 | ...transaction, |
| 332 | mutations: { |
| 333 | ...transaction.mutations.map((mutation) => { |
| 334 | return { |
| 335 | ...mutation, |
| 336 | createdAt: `[REDACTED]`, |
| 337 | updatedAt: `[REDACTED]`, |
| 338 | mutationId: `[REDACTED]`, |
| 339 | } |
| 340 | }), |
| 341 | }, |
| 342 | } |
| 343 | |
| 344 | // Call the mock function with the redacted transaction |
| 345 | persistMock({ transaction: redactedTransaction }) |
| 346 | |
| 347 | // Call the mock function with the transaction |
| 348 | syncMock({ transaction }) |
| 349 | |
| 350 | emitter.emit(`sync`, transaction.mutations) |
| 351 | return Promise.resolve() |
| 352 | } |
| 353 | |
| 354 | // Test insert with auto-generated key |
| 355 | const data = { id: 1, value: `bar` } |
no test coverage detected