add support for test mode detection in modulename.js via index.html (#3631)

in some cases the modulename.js may need to detect running in test mode
(compliments pr #3630)

window.name is not set  web mode

add a new field to the index.html 
window.intest 
and use the server_function to replace the hard coded string like we do
for window.mmversion=#VERSION#
then change the two  test helpers to set the env variable
app.js detects and sets global.intest=true
server func replace with value of global.intest

then module can use   if(window.intest)
This commit is contained in:
sam detweiler
2024-11-12 08:58:36 -06:00
committed by GitHub
parent 4259d7c075
commit 56cb536df1
6 changed files with 6 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
if (systemDate) {
process.env.MOCK_DATE = systemDate;
}
process.env.mmTestMode = "true";
global.electronApp = await electron.launch({ args: electronParams });