From cb1e965e0274a7db56fe63d0bf408a710ad092a8 Mon Sep 17 00:00:00 2001 From: Sylvain Lesage Date: Fri, 8 Nov 2024 22:23:35 +0100 Subject: [PATCH] simulate an async operation (#33) --- test/asyncbuffer.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/asyncbuffer.test.js b/test/asyncbuffer.test.js index 2c516e1..2117359 100644 --- a/test/asyncbuffer.test.js +++ b/test/asyncbuffer.test.js @@ -5,6 +5,7 @@ describe('cachedAsyncBuffer', () => { it('caches slices of a file to avoid multiple reads', async () => { const slice = vi.fn(async (start, end) => { // Simulate an async slice operation + await new Promise(resolve => setTimeout(resolve, 10)) if (end === undefined) end = 1000 if (start < 0) start = Math.max(0, 1000 + start) const buffer = new ArrayBuffer(end - start)