aotrautils 0.0.1594 → 0.0.1595

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 (12/05/2025-16:24:40)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (12/05/2025-23:41:39)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -433,7 +433,7 @@ if(!window.aotestAllTestsManager){
433
433
  window.aotestAllTestsManager={
434
434
  isEmpty:function(){
435
435
  let result=true;
436
- foreach(this,(test,testNameLocal)=>{
436
+ foreach(window.aotestAllTestsManager,(test,testNameLocal)=>{
437
437
  result=false;
438
438
  return "break";
439
439
  },(test,testNameLocal)=>{ return !window.aotestMethods.aotratestKeyInPredefinedParameters(testNameLocal); });
@@ -441,8 +441,9 @@ if(!window.aotestAllTestsManager){
441
441
  }
442
442
  };
443
443
 
444
- if(!window.aotestAllTestsManager.dummies)
444
+ if(!window.aotestAllTestsManager.dummies){
445
445
  window.aotestAllTestsManager.dummies=new Object();
446
+ }
446
447
  window.aotestAllTestsManager.activateAsserts=false;
447
448
  window.aotestAllTestsManager.currentRunningScenario=null;
448
449
  };
@@ -451,22 +452,19 @@ if(!window.aotestAllTestsManager){
451
452
 
452
453
  // Utility methods for aotest framework :
453
454
 
454
- window.aotestMethods.getParentTestByScenarioName=function(scenarioName){
455
- return foreach(this.getTests(),test=>{
456
- return window.aotestMethods.iterateOverScenariiInTest(test, (parentTest, scenario)=>{
455
+ window.aotestMethods.getParentTestByScenarioName=function(allTests, scenarioName){
456
+ return foreach(allTests,test=>{
457
+ return window.aotestMethods.iterateOverScenariiInSingleTest(test, (parentTest, scenario)=>{
457
458
  if(scenario.name===scenarioName)
458
459
  return parentTest;
459
460
  });
460
461
  });
461
462
  }
462
-
463
-
464
463
  window.aotestMethods.getScenarioByName=function(allTests, scenarioName){
465
464
  const result=window.aotestMethods.iterateOverScenarii(allTests, null, null, null, scenario=>scenario.name===scenarioName);
466
465
  if(result) return result;
467
466
  return null;
468
467
  }
469
-
470
468
  window.aotestMethods.getScenariiByName=function(allTests, scenariiNames){
471
469
  const results=[];
472
470
  window.aotestMethods.iterateOverScenarii(allTests, (scenario, test)=>{
@@ -474,27 +472,6 @@ window.aotestMethods.getScenariiByName=function(allTests, scenariiNames){
474
472
  }, null, null, scenario=>contains(scenariiNames,scenario.name));
475
473
  return results;
476
474
  }
477
-
478
-
479
- window.aotestMethods.getScenarioInTest=function(test, scenarioName=null){
480
- if(!scenarioName) return null;
481
- return window.aotestMethods.iterateOverScenariiInTest(test,(t,s,sName)=>{
482
- if(sName===scenarioName){
483
- return s;
484
- }
485
- });
486
- };
487
-
488
- window.aotestMethods.getScenariiInTest=function(test, scenariiNames=null){
489
- let results={};
490
- window.aotestMethods.iterateOverScenariiInTest(test,(t,s,sName)=>{
491
- if(!scenariiNames || contains(scenariiNames, sName)){
492
- results[sName]=s;
493
- }
494
- });
495
- return results;
496
- };
497
-
498
475
  window.aotestMethods.getNumberOfScenariiInGlobal=function(allTestsBagForClientReadOnly, testsType){
499
476
  let currentScenariiNumber=0;
500
477
  window.aotestMethods.iterateOverScenarii(allTestsBagForClientReadOnly, (scenario)=>{
@@ -502,19 +479,7 @@ window.aotestMethods.getNumberOfScenariiInGlobal=function(allTestsBagForClientRe
502
479
  }, testsType);
503
480
  return currentScenariiNumber;
504
481
  }
505
-
506
-
507
- window.aotestMethods.iterateOverScenariiInTest=function(test, doOnEachIteration=null){
508
- if(!doOnEachIteration) return;
509
- return foreach(test,(scenario,scenarioName)=>{
510
- const result=doOnEachIteration(test,scenario,scenarioName);
511
- if(!nothing(result)) return result;
512
- },(scenario,scenarioName)=>{ return window.aotestMethods.isScenarioName(scenarioName); });
513
- };
514
-
515
-
516
- /*public*/window.aotestMethods.iterateOverScenarii=function(allTests, doOnIteration, testsType=null, filterFunction=null, mustTerminateFunction=null){
517
-
482
+ window.aotestMethods.iterateOverScenarii=function(allTests, doOnIteration, testsType=null, filterFunction=null, mustTerminateFunction=null){
518
483
  if(testsType){
519
484
  if(testsType==="*"){
520
485
  return foreach(allTests,(allTestsByType,t)=>{
@@ -523,22 +488,18 @@ window.aotestMethods.iterateOverScenariiInTest=function(test, doOnEachIteration=
523
488
  return loopResult;
524
489
  });
525
490
  }
526
-
527
491
  const allTestsByType=allTests[testsType];
528
492
  return window.aotestMethods.doForAllTestsByType(allTestsByType, doOnIteration, filterFunction, mustTerminateFunction);
529
493
  }
530
-
531
494
  const allTestsByType=allTests;
532
495
  return window.aotestMethods.doForAllTestsByType(allTestsByType, doOnIteration, filterFunction, mustTerminateFunction);
533
496
  };
534
497
 
535
-
536
498
  /*private*/window.aotestMethods.doForAllTestsByType=function(allTestsByType, doOnIteration, filterFunction=null, mustTerminateFunction=null){
537
-
538
499
  const loopResultI=foreach(allTestsByType,(testsByFunction,methodName)=>{
539
500
  const loopResultJ=foreach(testsByFunction,(test,executionCoupleName)=>{ // (execution couple IS test)
540
501
 
541
- const scenarii=aotestMethods.getScenariiInTest(test);
502
+ const scenarii=aotestMethods.getScenariiInSingleTest(test);
542
503
  const loopResultK=foreach(scenarii,(scenario, scenarioName)=>{
543
504
 
544
505
  if(doOnIteration) doOnIteration(scenario, test);
@@ -547,20 +508,44 @@ window.aotestMethods.iterateOverScenariiInTest=function(test, doOnEachIteration=
547
508
 
548
509
  },(scenario, scenarioName)=>!filterFunction || filterFunction(scenario));
549
510
 
550
- if(loopResultK)
551
- return loopResultK;
552
-
511
+ if(loopResultK) return loopResultK;
553
512
  });
554
513
 
555
- if(loopResultJ)
556
- return loopResultJ;
557
-
514
+ if(loopResultJ) return loopResultJ;
558
515
  });
559
516
 
560
517
  return loopResultI;
561
518
  }
562
519
 
563
520
 
521
+ window.aotestMethods.getScenarioInSingleTest=function(test, scenarioName=null){
522
+ if(!scenarioName) return null;
523
+ return window.aotestMethods.iterateOverScenariiInSingleTest(test,(t,s,sName)=>{
524
+ if(sName===scenarioName){
525
+ return s;
526
+ }
527
+ });
528
+ };
529
+ window.aotestMethods.getScenariiInSingleTest=function(test, scenariiNames=null){
530
+ let results={};
531
+ window.aotestMethods.iterateOverScenariiInSingleTest(test,(t,s,sName)=>{
532
+ if(!scenariiNames || contains(scenariiNames, sName)){
533
+ results[sName]=s;
534
+ }
535
+ });
536
+ return results;
537
+ };
538
+ window.aotestMethods.iterateOverScenariiInSingleTest=function(test, doOnEachIteration=null){
539
+ if(!doOnEachIteration) return;
540
+ return foreach(test,(scenario,scenarioName)=>{
541
+ const result=doOnEachIteration(test,scenario,scenarioName);
542
+ if(!nothing(result)) return result;
543
+ },(scenario,scenarioName)=>{ return window.aotestMethods.isScenarioName(scenarioName); });
544
+ };
545
+
546
+
547
+
548
+
564
549
 
565
550
  /*public*/window.aotestMethods.iterateOverValuesOnClonedObject=function(scenarioParam, doOnIterationForValue, visited=[], valuePath="", isValueFunction=null){
566
551
 
@@ -604,7 +589,6 @@ window.aotestMethods.iterateOverScenariiInTest=function(test, doOnEachIteration=
604
589
  };
605
590
 
606
591
 
607
-
608
592
  window.aotestMethods.isScenarioName=function(scenarioName){
609
593
  return contains(scenarioName,"_scenario");
610
594
  };
@@ -1341,7 +1325,7 @@ aotest.run=function(testName=null,scenarioName=null){
1341
1325
  // // DBG
1342
1326
  // console.log("chosenTestParam",chosenTestParam);
1343
1327
 
1344
- foreach(aotestMethods.getScenariiInTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1328
+ foreach(aotestMethods.getScenariiInSingleTest(scenariiListLocal), (scenario,scenarioNameLocal)=>{
1345
1329
 
1346
1330
  // DBG
1347
1331
  console.log("WE RUN ONE SCENARIO !!!");
@@ -4942,7 +4926,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4942
4926
 
4943
4927
 
4944
4928
 
4945
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (12/05/2025-16:24:40)»*/
4929
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (12/05/2025-23:41:39)»*/
4946
4930
  /*-----------------------------------------------------------------------------*/
4947
4931
  /* ## Utility global methods in a browser (htmljs) client environment.
4948
4932
  *
@@ -13544,7 +13528,7 @@ getAORTACClient=function(clientId=getUUID(), serverNodeOrigin="ws://127.0.0.1:40
13544
13528
 
13545
13529
 
13546
13530
 
13547
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (12/05/2025-16:24:40)»*/
13531
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (12/05/2025-23:41:39)»*/
13548
13532
  /*-----------------------------------------------------------------------------*/
13549
13533
 
13550
13534
 
@@ -14783,7 +14767,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14783
14767
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14784
14768
 
14785
14769
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14786
- /*utils AI library associated with aotra version : «1_29072022-2359 (12/05/2025-16:24:40)»*/
14770
+ /*utils AI library associated with aotra version : «1_29072022-2359 (12/05/2025-23:41:39)»*/
14787
14771
  /*-----------------------------------------------------------------------------*/
14788
14772
 
14789
14773
 
@@ -14929,7 +14913,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14929
14913
 
14930
14914
 
14931
14915
 
14932
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (12/05/2025-16:24:40)»*/
14916
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (12/05/2025-23:41:39)»*/
14933
14917
  /*-----------------------------------------------------------------------------*/
14934
14918
 
14935
14919
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1594",
3
+ "version": "0.0.1595",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",