Skip to content

Commit

Permalink
test(TypeScript): support custom Error type
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Aug 16, 2020
1 parent 58a3c04 commit 9d83bee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ expectType<IterableIterator<Error>>(aggregateError[Symbol.iterator]());
for (const error of aggregateError) {
expectType<Error>(error);
}

interface CustomError extends Error {
foo: string;
}
const customAggregateError = new AggregateError<CustomError>([
new Error('foo')
]);

for (const error of customAggregateError) {
expectType<string>(error.foo);
}

0 comments on commit 9d83bee

Please sign in to comment.