aotrautils-srv 0.0.525 → 0.0.527

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/07/2023-22:43:15)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/07/2023-12:04:35)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -448,7 +448,7 @@ if(!window.aotestAllTestsManager){
448
448
  };
449
449
 
450
450
  // Utility methods for aotest framework :
451
- window.aotestMethods.getScenariosInTest=function(test){
451
+ window.aotestMethods.getScenariiInTest=function(test){
452
452
  let results={};
453
453
  foreach(test,(s,sKey)=>{
454
454
  results[sKey]=s;
@@ -456,6 +456,51 @@ window.aotestMethods.getScenariosInTest=function(test){
456
456
  return results;
457
457
  };
458
458
 
459
+ window.aotestMethods.iterateInScenarii=function(allTests, doOnIteration, testsType=null, filter=null){
460
+
461
+ if(testsType){
462
+
463
+ foreach(allTests[testsType],(testsByFunction,functionName)=>{
464
+ foreach(testsByFunction,(test,executionCoupleName)=>{
465
+
466
+ const scenarii=aotestMethods.getScenariiInTest(test)
467
+ foreach(scenarii,(scenario, scenarioName)=>{
468
+
469
+ doOnIteration(scenario);
470
+
471
+ },(scenario, scenarioName)=>contains(scenariiNames, scenario.name) && (filter && filter(scenario)));
472
+ });
473
+ });
474
+ }else{
475
+
476
+ foreach(allTests,(allTestsByType,t)=>{
477
+
478
+ foreach(allTestsByType,(testsByFunction,functionName)=>{
479
+ foreach(testsByFunction,(test,executionCoupleName)=>{
480
+
481
+ const scenarii=aotestMethods.getScenariiInTest(test)
482
+ foreach(scenarii,(scenario, scenarioName)=>{
483
+
484
+ doOnIteration(scenario);
485
+
486
+ },(scenario, scenarioName)=>contains(scenariiNames, scenario.name) && (filter && filter(scenario)));
487
+ });
488
+ });
489
+
490
+ });
491
+
492
+
493
+ }
494
+
495
+ };
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
459
504
  window.aotestMethods.isScenarioName=function(scenarioName){
460
505
  return contains(scenarioName,"_scenario");
461
506
  };
@@ -1191,7 +1236,7 @@ aotest.run=function(testName=null,scenarioName=null){
1191
1236
  // // DBG
1192
1237
  // console.log("chosenTestParam",chosenTestParam);
1193
1238
 
1194
- foreach(aotestMethods.getScenariosInTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1239
+ foreach(aotestMethods.getScenariiInTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1195
1240
 
1196
1241
  // DBG
1197
1242
  console.log("WE RUN ONE SCENARIO !!!");
@@ -4874,7 +4919,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4874
4919
 
4875
4920
 
4876
4921
 
4877
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/07/2023-22:43:15)»*/
4922
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/07/2023-12:04:35)»*/
4878
4923
  /*-----------------------------------------------------------------------------*/
4879
4924
 
4880
4925
 
@@ -4977,15 +5022,15 @@ if(typeof(fs)==="undefined"){
4977
5022
 
4978
5023
 
4979
5024
  let resultData={};
5025
+
5026
+ // 1)
4980
5027
  if(!empty(resultFlat)) resultData=JSON.parse(resultFlat);
4981
-
4982
5028
 
5029
+ // 2)
4983
5030
  if(!empty(resultData) && isFlatMap(resultData)){
4984
-
4985
5031
  resultData=getAsTreeStructure(resultData,true
4986
- // We have to keep the type information, here too ! (in the sub-objects)
4987
- ,false);
4988
-
5032
+ // We have to keep the type information, here too ! (in the sub-objects)
5033
+ ,false);
4989
5034
  }
4990
5035
 
4991
5036
  return resultData;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.525",
3
+ "version": "0.0.527",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",