Function
createTransaction
({
id,
createdAt,
nextAttemptAt,
retryCount = 0,
}: {
id: string
createdAt: Date
nextAttemptAt: number
retryCount?: number
})
Source from the content-addressed store, hash-verified
| 3 | import type { OfflineTransaction } from '../src/types' |
| 4 | |
| 5 | function createTransaction({ |
| 6 | id, |
| 7 | createdAt, |
| 8 | nextAttemptAt, |
| 9 | retryCount = 0, |
| 10 | }: { |
| 11 | id: string |
| 12 | createdAt: Date |
| 13 | nextAttemptAt: number |
| 14 | retryCount?: number |
| 15 | }): OfflineTransaction { |
| 16 | return { |
| 17 | id, |
| 18 | mutationFnName: `syncData`, |
| 19 | mutations: [], |
| 20 | keys: [], |
| 21 | idempotencyKey: `idempotency-${id}`, |
| 22 | createdAt, |
| 23 | retryCount, |
| 24 | nextAttemptAt, |
| 25 | metadata: {}, |
| 26 | version: 1, |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | describe(`KeyScheduler`, () => { |
| 31 | afterEach(() => { |
Tested by
no test coverage detected