Copy link
@personalizedrefrigerator

personalizedrefrigerator Feb 8, 2024

Collaborator

It looks like a test related to this line is now failing:

 FAIL utils/restartInSafeModeFromMain.test.js
 YN0000: [@joplin/app-desktop]:   ● restartInSafeModeFromMain › should create a safe mode flag file
 YN0000: [@joplin/app-desktop]: 
 YN0000: [@joplin/app-desktop]:     TypeError: (0 , bridge_1.default)(...).appName is not a function
 YN0000: [@joplin/app-desktop]: 
 YN0000: [@joplin/app-desktop]:       12 | 	// Only set constants here -- the main process doesn't have easy access (without loading
 YN0000: [@joplin/app-desktop]:       13 | 	// a large amount of other code) to the database.
 YN0000: [@joplin/app-desktop]:     > 14 | 	const appName = bridge().appName();
 YN0000: [@joplin/app-desktop]:          | 	                         ^
 YN0000: [@joplin/app-desktop]:       15 | 	Setting.setConstant('appId', `net.cozic.${appName}`);
 YN0000: [@joplin/app-desktop]:       16 | 	Setting.setConstant('appType', 'desktop');
 YN0000: [@joplin/app-desktop]:       17 | 	Setting.setConstant('appName', appName);
 YN0000: [@joplin/app-desktop]: 
 YN0000: [@joplin/app-desktop]:       at appName (utils/restartInSafeModeFromMain.ts:14:27)
 YN0000: [@joplin/app-desktop]:       at utils/restartInSafeModeFromMain.js:27:67
 YN0000: [@joplin/app-desktop]:       at Object.<anonymous>.__awaiter (utils/restartInSafeModeFromMain.js:9:10)
 YN0000: [@joplin/app-desktop]:       at __awaiter (utils/restartInSafeModeFromMain.ts:11:46)
 YN0000: [@joplin/app-desktop]:       at utils/restartInSafeModeFromMain.test.ts:38:34
 YN0000: [@joplin/app-desktop]:       at utils/restartInSafeModeFromMain.test.js:27:67
 YN0000: [@joplin/app-desktop]:       at Object.<anonymous>.__awaiter (utils/restartInSafeModeFromMain.test.js:9:10)
 YN0000: [@joplin/app-desktop]:       at Object.__awaiter (utils/restartInSafeModeFromMain.test.ts:37:57

It seems that the issue is caused by a partial mock of bridge.ts that's used for the test.