test: improve statistic helpers tests
[e-mobility-charging-stations-simulator.git] / src / utils / Configuration.ts
index 37569086ac69ba34e15340117c3c5bc4d3dae1ab..90e846036074be5f3b71146df687313706b9cd3f 100644 (file)
@@ -128,16 +128,18 @@ export class Configuration {
     !Utils.isUndefined(Configuration.getConfig()['stationTemplateURLs']) &&
       (Configuration.getConfig().stationTemplateUrls = Configuration.getConfig()[
         'stationTemplateURLs'
-      ] as unknown as StationTemplateUrl[]);
-    Configuration.getConfig().stationTemplateUrls.forEach((stationUrl: StationTemplateUrl) => {
-      if (!Utils.isUndefined(stationUrl['numberOfStation'])) {
-        console.error(
-          chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key 'numberOfStation' usage for template file '${
-            stationUrl.file
-          }' in 'stationTemplateUrls'. Use 'numberOfStations' instead}`
-        );
+      ] as StationTemplateUrl[]);
+    Configuration.getConfig().stationTemplateUrls.forEach(
+      (stationTemplateUrl: StationTemplateUrl) => {
+        if (!Utils.isUndefined(stationTemplateUrl['numberOfStation'])) {
+          console.error(
+            chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key 'numberOfStation' usage for template file '${
+              stationTemplateUrl.file
+            }' in 'stationTemplateUrls'. Use 'numberOfStations' instead}`
+          );
+        }
       }
-    });
+    );
     // Read conf
     return Configuration.getConfig()?.stationTemplateUrls;
   }
@@ -191,7 +193,7 @@ export class Configuration {
     let workerConfiguration: WorkerConfiguration = {
       processType: Utils.hasOwnProp(Configuration.getConfig(), 'workerProcess')
         ? Configuration.getConfig()?.workerProcess
-        : WorkerProcessType.WORKER_SET,
+        : WorkerProcessType.workerSet,
       startDelay: Utils.hasOwnProp(Configuration.getConfig(), 'workerStartDelay')
         ? Configuration.getConfig()?.workerStartDelay
         : WorkerConstants.DEFAULT_WORKER_START_DELAY,
@@ -322,13 +324,13 @@ export class Configuration {
     ) {
       console.error(
         chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${
-          logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}`
+          logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
         }}`
       );
     } else if (!Utils.isUndefined(Configuration.getConfig()[key])) {
       console.error(
         chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${
-          logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}`
+          logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
         }}`
       );
     }