diff --git a/www/__mocks__/cordovaMocks.ts b/www/__mocks__/cordovaMocks.ts index 1d3934ea4..1f563c7e7 100644 --- a/www/__mocks__/cordovaMocks.ts +++ b/www/__mocks__/cordovaMocks.ts @@ -29,6 +29,7 @@ export const mockFile = () => { window['cordova'].file = { dataDirectory: '../path/to/data/directory', applicationStorageDirectory: '../path/to/app/storage/directory', + tempDirectory: '../path/to/temp/directory', }; }; diff --git a/www/__mocks__/fileSystemMocks.ts b/www/__mocks__/fileSystemMocks.ts index 70b532507..1648c2f4b 100644 --- a/www/__mocks__/fileSystemMocks.ts +++ b/www/__mocks__/fileSystemMocks.ts @@ -1,4 +1,9 @@ export const mockFileSystem = () => { + type MockFileWriter = { + onreadend: any; + onerror: (e: any) => void; + write: (obj: Blob) => void; + }; window['resolveLocalFileSystemURL'] = function (parentDir, handleFS) { const fs = { filesystem: { @@ -9,6 +14,8 @@ export const mockFileSystem = () => { let file = new File(['this is a mock'], 'loggerDB'); handleFile(file); }, + nativeURL: 'file:///Users/Jest/test/URL/', + isFile: true, }; onSuccess(fileEntry); }, diff --git a/www/index.html b/www/index.html index 72c75eb01..44fcb5bbf 100644 --- a/www/index.html +++ b/www/index.html @@ -15,4 +15,4 @@