Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incremental(stream): revert test logic #4101

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/execution/__tests__/stream-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,9 @@ describe('Execute: stream directive', () => {
hasNext: true,
});

const result2 = await iterator.next();
const result2Promise = iterator.next();
resolveIterableCompletion(null);
const result2 = await result2Promise;
expectJSON(result2).toDeepEqual({
value: {
pending: [{ id: '2', path: ['friendList', 1], label: 'DeferName' }],
Expand All @@ -1960,7 +1962,7 @@ describe('Execute: stream directive', () => {
});

const result3Promise = iterator.next();
resolveIterableCompletion(null);
resolveSlowField('Han');
const result3 = await result3Promise;
expectJSON(result3).toDeepEqual({
value: {
Expand All @@ -1969,9 +1971,7 @@ describe('Execute: stream directive', () => {
},
done: false,
});
const result4Promise = iterator.next();
resolveSlowField('Han');
const result4 = await result4Promise;
const result4 = await iterator.next();
expectJSON(result4).toDeepEqual({
value: {
incremental: [
Expand Down Expand Up @@ -2062,19 +2062,8 @@ describe('Execute: stream directive', () => {
done: false,
});

const result3Promise = iterator.next();
resolveIterableCompletion(null);
const result3 = await result3Promise;
const result3 = await iterator.next();
expectJSON(result3).toDeepEqual({
value: {
completed: [{ id: '1' }],
hasNext: true,
},
done: false,
});

const result4 = await iterator.next();
expectJSON(result4).toDeepEqual({
value: {
incremental: [
{
Expand All @@ -2083,6 +2072,17 @@ describe('Execute: stream directive', () => {
},
],
completed: [{ id: '2' }],
hasNext: true,
},
done: false,
});

const result4Promise = iterator.next();
resolveIterableCompletion(null);
const result4 = await result4Promise;
expectJSON(result4).toDeepEqual({
value: {
completed: [{ id: '1' }],
hasNext: false,
},
done: false,
Expand Down
Loading