Skip to content

Commit

Permalink
use assert instead of type cast
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Jun 7, 2022
1 parent 211e3f2 commit a735422
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/execution/__tests__/subscribe-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,9 @@ describe('Subscription Initialization Phase', () => {
'Subscription field must return Async Iterable. Received: "test".',
);

(
await expectPromise(
subscribeWithFn(() =>
Promise.resolve('test'),
) as Promise<ExecutionResult>,
)
).toRejectWith(
const result = subscribeWithFn(() => Promise.resolve('test'));
assert(isPromise(result));
(await expectPromise(result)).toRejectWith(
'Subscription field must return Async Iterable. Received: "test".',
);
});
Expand Down

0 comments on commit a735422

Please sign in to comment.