You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tabris.js version: 3.9.0-dev.20230630 also tried with 3.9.0-dev.20240212
tabris._init is used in test runs, until now no issues in productive code noticed
Code snippet
import{tabris}from'tabris';importClientMockfrom'tabris/ClientMock';constDEFAULT_APP_VERSION='1.0.0';constDEFAULT_DEVICE_ORIENTATION='portrait';constDEFAULT_DEVICE_PLATFORM='Android';constDEFAULT_DEVICE_MODEL='foo';constDEFAULT_FILESYSTEM_PATH='path';exportfunctionreset(){constclientOptions=getDefaultMockClientOptions();constclientMock=newClientMock(clientOptions);tabris._init(clientMock);}functiongetDefaultMockClientOptions(){return{'tabris.App': { ...getAppVersionOptions(DEFAULT_APP_VERSION)},'tabris.Device': { ...getDeviceOptions()},'tabris.FileSystem': { ...getFileSystemOptions(DEFAULT_FILESYSTEM_PATH)}};}functiongetFileSystemOptions(filesDir: string){return{
filesDir,readDir: (name: any)=>{if(typeofname==='string'){returnPromise.resolve([]);}returnPromise.reject('folder path should be a string');},writeFile: ()=>Promise.resolve(),readFile: ()=>Promise.resolve()};}functiongetDeviceOptions(platform: string=DEFAULT_DEVICE_PLATFORM,model: string=DEFAULT_DEVICE_MODEL,orientation: string=DEFAULT_DEVICE_ORIENTATION){return{
...getDeviceOrientationOptions(orientation),
...getDeviceModelOptions(model),
...getDevicePlatformOptions(platform)};}functiongetDevicePlatformOptions(platform: string){return{ platform };}functiongetDeviceModelOptions(model: string){return{ model };}functiongetDeviceOrientationOptions(orientation: string){return{ orientation };}functiongetAppVersionOptions(version: string){return{ version };}reset();
The text was updated successfully, but these errors were encountered:
Would be relevant to know what invironment your tests run in. I just checked, and it seems consistent with deno that window.crypto can not be set. Try using node.
Problem description
Calling reset() from the appended snippet in test runs leads to
Expected behavior
No error, test runs succeeding.
Environment
tabris._init is used in test runs, until now no issues in productive code noticed
Code snippet
The text was updated successfully, but these errors were encountered: