testilo 31.2.1 → 31.3.1
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.
- package/package.json +1 -1
- package/procs/score/tsp40.js +11 -4
package/package.json
CHANGED
package/procs/score/tsp40.js
CHANGED
|
@@ -17,8 +17,9 @@ const scoreProcID = 'tsp40';
|
|
|
17
17
|
const latencyWeight = 1;
|
|
18
18
|
// Normal latency (6 visits, with 1.5 second per visit).
|
|
19
19
|
const normalLatency = 9;
|
|
20
|
-
// Prevention
|
|
20
|
+
// Prevention weights (how much each prevention adds to the score).
|
|
21
21
|
const preventionWeight = 300;
|
|
22
|
+
const testaroRulePreventionWeight = 30;
|
|
22
23
|
// Maximum instance count addition weight (divisor of max).
|
|
23
24
|
const maxWeight = 30;
|
|
24
25
|
// Issue count weight.
|
|
@@ -77,6 +78,7 @@ exports.scorer = report => {
|
|
|
77
78
|
log: logWeights,
|
|
78
79
|
latency: latencyWeight,
|
|
79
80
|
prevention: preventionWeight,
|
|
81
|
+
testaroRulePrevention: testaroRulePreventionWeight,
|
|
80
82
|
maxInstanceCount: maxWeight
|
|
81
83
|
},
|
|
82
84
|
normalLatency,
|
|
@@ -104,9 +106,14 @@ exports.scorer = report => {
|
|
|
104
106
|
const {summary, details} = score;
|
|
105
107
|
// For each test act:
|
|
106
108
|
testActs.forEach(act => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (
|
|
109
|
+
const {data, which, standardResult} = act;
|
|
110
|
+
// If the tool is Testaro and the count of rule preventions was reported:
|
|
111
|
+
if (which === 'testaro' && data && data.rulePreventions) {
|
|
112
|
+
// Add their score to the score.
|
|
113
|
+
details.prevention.testaro = testaroRulePreventionWeight * data.rulePreventions.length;
|
|
114
|
+
}
|
|
115
|
+
// Otherwile, if the page prevented the tool from operating:
|
|
116
|
+
else if (! standardResult || standardResult.prevented) {
|
|
110
117
|
// Add this to the score.
|
|
111
118
|
details.prevention[which] = preventionWeight;
|
|
112
119
|
}
|