Skip to content

Commit cf67fb6

Browse files
committed
add tests for passing through exact originalError
1 parent 8c3f805 commit cf67fb6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/execution/__tests__/abort-signal-test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ describe('Execute: Cancellation', () => {
9393

9494
const result = await resultPromise;
9595

96+
expect(result.errors?.[0].originalError?.name).to.equal('AbortError');
97+
9698
expectJSON(result).toDeepEqual({
9799
data: {
98100
todo: null,
@@ -135,10 +137,13 @@ describe('Execute: Cancellation', () => {
135137
},
136138
});
137139

138-
abortController.abort(new Error('Custom abort error'));
140+
const customError = new Error('Custom abort error');
141+
abortController.abort(customError);
139142

140143
const result = await resultPromise;
141144

145+
expect(result.errors?.[0].originalError).to.equal(customError);
146+
142147
expectJSON(result).toDeepEqual({
143148
data: {
144149
todo: null,

0 commit comments

Comments
 (0)