( interactions: ReadonlyArray<HttpInteraction>, incoming: RequestSnapshot, match: RequestMatcher, index: number, )
| 93 | } |
| 94 | |
| 95 | export const selectSequential = ( |
| 96 | interactions: ReadonlyArray<HttpInteraction>, |
| 97 | incoming: RequestSnapshot, |
| 98 | match: RequestMatcher, |
| 99 | index: number, |
| 100 | ): { readonly interaction: HttpInteraction | undefined; readonly detail: string } => { |
| 101 | const interaction = interactions[index] |
| 102 | if (!interaction) return { interaction, detail: `interaction ${index + 1} of ${interactions.length} not recorded` } |
| 103 | if (!match(incoming, interaction.request)) |
| 104 | return { interaction: undefined, detail: requestDiff(interaction.request, incoming).join("\n") } |
| 105 | return { interaction, detail: "" } |
| 106 | } |
no test coverage detected