import {assert, type ErrorMatchOptions} from '@augment-vir/assert';
// define the options
const matchOptions: ErrorMatchOptions = {
matchConstructor: Error,
matchMessage: 'some error',
};
assert.throws(
() => {
throw new Error('some error');
},
// use the options
matchOptions,
); // this assertion will pass
A type that represents possible error matching patterns. This is used by the
.throws
andisError
, guards in@augment-vir/assert
as well asitCases
in@augment-vir/test
. Each property is optional, and whichever properties are provided will be checked.