mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
committed by
David Lechner
parent
ce26de9722
commit
3fc275eaed
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user