From 3fc275eaedd339b77ceb7a310e5412adfdbd9d12 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 18 May 2023 09:27:44 -0500 Subject: [PATCH] fix node 18 type resolution error After updating to @types/node 18.x, we started getting an error when mocking FileWithHandle. For some reason, the type hints don't allow for partial implementation anymore. Hack around the problem by just casting the partial implementation. --- src/explorer/sagas.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/explorer/sagas.test.ts b/src/explorer/sagas.test.ts index f697031b..7415aae2 100644 --- a/src/explorer/sagas.test.ts +++ b/src/explorer/sagas.test.ts @@ -204,7 +204,7 @@ describe('handleExplorerImportFiles', () => { }; const mockPythonFile = (name: string, contents: string) => { - return mock({ + return mock({ name, type: '', text: () => Promise.resolve(contents), @@ -212,7 +212,7 @@ describe('handleExplorerImportFiles', () => { }; const mockZipFile = (name: string, contents: ArrayBuffer) => { - return mock({ + return mock({ name, type: 'application/zip', arrayBuffer: () => Promise.resolve(contents),