From 7efa4f1a8a0d9afcc1303a1bb1a19617ca58ccbe Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Wed, 7 Jul 2021 19:11:44 -0500 Subject: [PATCH] Speed up a link preview fetch test --- ts/test-electron/linkPreviews/linkPreviewFetch_test.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts index 060d9897fd..580f4d6a1c 100644 --- a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts +++ b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts @@ -844,8 +844,6 @@ describe('link preview fetching', () => { }); it('stops reading bodies after 500 kilobytes', async function test() { - this.timeout(10000); - const shouldNeverBeCalled = sinon.stub(); const fakeFetch = stub().resolves( @@ -854,10 +852,9 @@ describe('link preview fetching', () => { yield new TextEncoder().encode( 'foo bar' ); - const spaces = new Uint8Array(1024).fill(32); - for (let i = 0; i < 500; i += 1) { - yield spaces; - } + const spaces = new Uint8Array(250 * 1024).fill(32); + yield spaces; + yield spaces; shouldNeverBeCalled(); yield new TextEncoder().encode( ''