aotrautils-srv 0.0.537 → 0.0.539
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 (
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (22/07/2023-03:14:05)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -450,23 +450,22 @@ if(!window.aotestAllTestsManager){
|
|
|
450
450
|
// Utility methods for aotest framework :
|
|
451
451
|
window.aotestMethods.getScenariiInTest=function(test){
|
|
452
452
|
let results={};
|
|
453
|
-
foreach(test,(
|
|
454
|
-
results[
|
|
455
|
-
},(
|
|
453
|
+
foreach(test,(scenario,scenarioName)=>{
|
|
454
|
+
results[scenarioName]=scenario;
|
|
455
|
+
},(scenario,scenarioName)=>{ return window.aotestMethods.isScenarioName(scenarioName); });
|
|
456
456
|
return results;
|
|
457
457
|
};
|
|
458
458
|
|
|
459
459
|
|
|
460
|
-
|
|
461
460
|
/*private*/window.aotestMethods.doForAllTestsByType=function(allTestsByType, doOnIteration, filter=null, mustTerminate=null){
|
|
462
461
|
|
|
463
462
|
const loopResultI=foreach(allTestsByType,(testsByFunction,functionName)=>{
|
|
464
|
-
const loopResultJ=foreach(testsByFunction,(test,executionCoupleName)=>{
|
|
463
|
+
const loopResultJ=foreach(testsByFunction,(test,executionCoupleName)=>{ // (execution couple IS test)
|
|
465
464
|
|
|
466
465
|
const scenarii=aotestMethods.getScenariiInTest(test)
|
|
467
466
|
const loopResultK=foreach(scenarii,(scenario, scenarioName)=>{
|
|
468
467
|
|
|
469
|
-
if(doOnIteration) doOnIteration(scenario);
|
|
468
|
+
if(doOnIteration) doOnIteration(scenario, test);
|
|
470
469
|
if(mustTerminate && mustTerminate(scenario))
|
|
471
470
|
return scenario;
|
|
472
471
|
|
|
@@ -491,19 +490,19 @@ window.aotestMethods.getScenariiInTest=function(test){
|
|
|
491
490
|
|
|
492
491
|
if(testsType==="*"){
|
|
493
492
|
return foreach(allTests,(allTestsByType,t)=>{
|
|
494
|
-
const
|
|
495
|
-
if(
|
|
496
|
-
return
|
|
493
|
+
const loopResult=window.aotestMethods.doForAllTestsByType(allTestsByType, doOnIteration, filter, mustTerminate);
|
|
494
|
+
if(loopResult)
|
|
495
|
+
return loopResult;
|
|
497
496
|
});
|
|
498
497
|
|
|
499
498
|
}
|
|
500
499
|
|
|
501
500
|
const allTestsByType=allTests[testsType];
|
|
502
|
-
return window.aotestMethods.doForAllTestsByType(allTestsByType,doOnIteration, filter, mustTerminate);
|
|
501
|
+
return window.aotestMethods.doForAllTestsByType(allTestsByType, doOnIteration, filter, mustTerminate);
|
|
503
502
|
}
|
|
504
503
|
|
|
505
504
|
const allTestsByType=allTests;
|
|
506
|
-
return window.aotestMethods.doForAllTestsByType(allTestsByType,doOnIteration, filter, mustTerminate);
|
|
505
|
+
return window.aotestMethods.doForAllTestsByType(allTestsByType, doOnIteration, filter, mustTerminate);
|
|
507
506
|
|
|
508
507
|
};
|
|
509
508
|
|
|
@@ -521,7 +520,7 @@ window.aotestMethods.isScenarioName=function(scenarioName){
|
|
|
521
520
|
// (a little utility function for the unitary tests framework aotest :)
|
|
522
521
|
window.aotestMethods.aotratestKeyInPredefinedParameters=function(key){
|
|
523
522
|
return contains(
|
|
524
|
-
["activateAsserts","currentRunningScenario","name","dummies","prerequisite","clean","
|
|
523
|
+
["activateAsserts","currentRunningScenario","name","dummies","prerequisite","clean","functionName",
|
|
525
524
|
"mainInstance","nature","isEmpty"],
|
|
526
525
|
key);
|
|
527
526
|
};
|
|
@@ -618,7 +617,7 @@ window.aotest=function(parameters,functionDefinition=null,ignoreTest=false,CLASS
|
|
|
618
617
|
// Parameters :
|
|
619
618
|
// Tested function/method name :
|
|
620
619
|
var functionName;
|
|
621
|
-
const functionNameParam=parameters.
|
|
620
|
+
const functionNameParam=parameters.functionName;
|
|
622
621
|
|
|
623
622
|
|
|
624
623
|
if(!functionDefinition){
|
|
@@ -669,9 +668,9 @@ window.aotest=function(parameters,functionDefinition=null,ignoreTest=false,CLASS
|
|
|
669
668
|
currentTest.name=nameParam;
|
|
670
669
|
|
|
671
670
|
// (optional) Func (ie. function name) :
|
|
672
|
-
let
|
|
673
|
-
if(!!
|
|
674
|
-
currentTest["
|
|
671
|
+
let functionName=parameters["functionName"];
|
|
672
|
+
if(!!functionName /*(forced to boolean)*/){
|
|
673
|
+
currentTest["functionName"]=functionName;
|
|
675
674
|
}
|
|
676
675
|
|
|
677
676
|
// We add to the global context :
|
|
@@ -4932,7 +4931,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4932
4931
|
|
|
4933
4932
|
|
|
4934
4933
|
|
|
4935
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (
|
|
4934
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (22/07/2023-03:14:05)»*/
|
|
4936
4935
|
/*-----------------------------------------------------------------------------*/
|
|
4937
4936
|
|
|
4938
4937
|
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.539",
|
|
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)",
|