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.
This commit is contained in:
David Lechner
2023-05-18 09:42:07 -05:00
committed by David Lechner
parent ce26de9722
commit 3fc275eaed
+2 -2
View File
@@ -204,7 +204,7 @@ describe('handleExplorerImportFiles', () => {
};
const mockPythonFile = (name: string, contents: string) => {
return mock<FileWithHandle>({
return mock<FileWithHandle>(<FileWithHandle>{
name,
type: '',
text: () => Promise.resolve(contents),
@@ -212,7 +212,7 @@ describe('handleExplorerImportFiles', () => {
};
const mockZipFile = (name: string, contents: ArrayBuffer) => {
return mock<FileWithHandle>({
return mock<FileWithHandle>(<FileWithHandle>{
name,
type: 'application/zip',
arrayBuffer: () => Promise.resolve(contents),