Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 13, 2022
1 parent 7445c67 commit 880d3bd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/execution/__tests__/executor-test.ts
Expand Up @@ -582,7 +582,7 @@ describe('Execute: Handles basic execution tasks', () => {
});

it('handles sync errors combined with rejections', async () => {
let isAsyncResolverCalled = false;
let isAsyncResolverFinished = false;

const schema = new GraphQLSchema({
query: new GraphQLObjectType({
Expand All @@ -598,8 +598,8 @@ describe('Execute: Handles basic execution tasks', () => {
await resolveOnNextTick();
await resolveOnNextTick();
await resolveOnNextTick();
isAsyncResolverCalled = true;
return Promise.resolve(null);
isAsyncResolverFinished = true;
return null;
},
},
},
Expand All @@ -614,10 +614,10 @@ describe('Execute: Handles basic execution tasks', () => {
}
`);

const result = await execute({ schema, document });
const result = execute({ schema, document });

expect(isAsyncResolverCalled).to.equal(true);
expectJSON(result).toDeepEqual({
expect(isAsyncResolverFinished).to.equal(false);
expectJSON(await result).toDeepEqual({
data: null,
errors: [
{
Expand All @@ -628,6 +628,7 @@ describe('Execute: Handles basic execution tasks', () => {
},
],
});
expect(isAsyncResolverFinished).to.equal(true);
});

it('Full response path is included for non-nullable fields', () => {
Expand Down

0 comments on commit 880d3bd

Please sign in to comment.