content/flux/v0/stdlib/testing/shoulderror.md
testing.shouldError() calls a function that catches any error and checks that the error matches the expected value.
(fn: () => A, want: regexp) => stream[{v: string}]
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) Function to call.
({{< req >}}) Regular expression to match the expected error.
import "testing"
testing.shouldError(fn: () => die(msg: "error message"), want: /error message/)