From 8dfe201b10e4816a47f4b2bdbf70d30fe7d06e6a Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Mon, 13 Jan 2020 18:35:47 +0000 Subject: [PATCH] Add test to confirm that toSuspenseSource ends on suspense --- src/utils/toSuspenseSource.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/toSuspenseSource.test.ts b/src/utils/toSuspenseSource.test.ts index 56c7e9ed50..b1c52ea93d 100644 --- a/src/utils/toSuspenseSource.test.ts +++ b/src/utils/toSuspenseSource.test.ts @@ -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');