Remote / foldkit-remote/testing

WriteScenario

interface · packages/remote/src/scenario.ts:54

interface WriteScenario<Principal> {
  readonly name: string
  readonly given: ReadonlyArray<{
    readonly entity: AnyEntity
    readonly row: Row
  }>
  readonly principal: Option.Option<Principal>
  readonly now: number
  readonly when: readonly [mutation: AnyMutation, input: unknown]
  readonly operation: string
  readonly expect: WriteExpectation
}

One write, the rows it starts from, and what every backend must say of it.

Members

WriteScenario.name

property · packages/remote/src/scenario.ts:55

readonly name: string

WriteScenario.given

property · packages/remote/src/scenario.ts:57

readonly given: ReadonlyArray<{
  readonly entity: AnyEntity
  readonly row: Row
}>

Encoded rows, seeded before the write: one or more per Entity.

WriteScenario.principal

property · packages/remote/src/scenario.ts:59

readonly principal: Option.Option<Principal>

Who asks: none is a visitor.

WriteScenario.now

property · packages/remote/src/scenario.ts:61

readonly now: number

The clock the write is decided at, in milliseconds since the epoch.

WriteScenario.when

property · packages/remote/src/scenario.ts:62

readonly when: readonly [mutation: AnyMutation, input: unknown]

WriteScenario.operation

property · packages/remote/src/scenario.ts:64

readonly operation: string

The operation id a retry repeats.

WriteScenario.expect

property · packages/remote/src/scenario.ts:65

readonly expect: WriteExpectation