(
ctx: Pick<FuzzIterationContext, "label" | "seed" | "iteration" | "caseSeed">,
cause: unknown,
notes: readonly string[],
)
| 44 | readonly notes: readonly string[]; |
| 45 | |
| 46 | constructor( |
| 47 | ctx: Pick<FuzzIterationContext, "label" | "seed" | "iteration" | "caseSeed">, |
| 48 | cause: unknown, |
| 49 | notes: readonly string[], |
| 50 | ) { |
| 51 | const detail = describeThrown(cause); |
| 52 | const noteText = notes.length === 0 ? "" : ` notes=[${notes.join("; ")}]`; |
| 53 | super( |
| 54 | `fuzz failed: ${ctx.label} seed=${hexSeed(ctx.seed)} iteration=${String( |
| 55 | ctx.iteration, |
| 56 | )} caseSeed=${hexSeed(ctx.caseSeed)}: ${detail}${noteText}`, |
| 57 | { cause }, |
| 58 | ); |
| 59 | this.name = "FuzzFailureError"; |
| 60 | this.label = ctx.label; |
| 61 | this.seed = ctx.seed; |
| 62 | this.iteration = ctx.iteration; |
| 63 | this.caseSeed = ctx.caseSeed; |
| 64 | this.notes = Object.freeze([...notes]); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | export function hexSeed(seed: number): string { |
nothing calls this directly
no test coverage detected