Hermes MongoDB
    Preparing search index...

    Type Alias NowFunction

    NowFunction: () => Date

    Function type that returns the current date/time.

    Used internally for timestamping operations. Can be overridden for testing.

    Type Declaration

      • (): Date
      • Returns Date

        Current date/time

    Using custom time function for testing

    const outbox = createOutboxConsumer({
    // ...
    now: () => new Date('2024-01-15T10:00:00Z') // Fixed time for tests
    })

    Default behavior

    const outbox = createOutboxConsumer({
    // ...
    // Defaults to: () => new Date()
    })