Skip to content

Commit

Permalink
Add test to confirm that toSuspenseSource ends on suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Jan 13, 2020
1 parent 60ecdee commit 8dfe201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/toSuspenseSource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ it('throws a promise that resolves when the source emits a value', () => {
expect(promise).toBeInstanceOf(Promise);

next('test');
expect(result).toBe('test');

// The result came in asynchronously and the original source has ended
expect(result).toBe(undefined);

return promise.then(resolved => {
expect(resolved).toBe('test');
Expand Down

0 comments on commit 8dfe201

Please sign in to comment.