testilo 3.9.0 → 3.9.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/sp15a.js +31 -9
package/package.json
CHANGED
package/procs/score/sp15a.js
CHANGED
|
@@ -59,6 +59,7 @@ const preWeightedPackages = ['axe', 'tenon', 'testaro'];
|
|
|
59
59
|
const testMatchers = {
|
|
60
60
|
nuVal: [
|
|
61
61
|
/^Attribute .+ not allowed on element .+ at this point.*$/,
|
|
62
|
+
/^Bad value .+ for attribute .+ on element “meta”.*$/,
|
|
62
63
|
/^CSS: “background-image”: .+ is not a “background-image” value.*$/
|
|
63
64
|
]
|
|
64
65
|
};
|
|
@@ -1515,6 +1516,10 @@ const groups = {
|
|
|
1515
1516
|
'Element “meta” is missing one or more of the following attributes: “itemprop”, “property”.': {
|
|
1516
1517
|
quality: 1,
|
|
1517
1518
|
what: 'meta element is missing an itemprop or property attribute'
|
|
1519
|
+
},
|
|
1520
|
+
'^Bad value .+ for attribute .+ on element “meta”.*$': {
|
|
1521
|
+
quality: 1,
|
|
1522
|
+
what: 'attribute of a meta element has an invalid value'
|
|
1518
1523
|
}
|
|
1519
1524
|
}
|
|
1520
1525
|
}
|
|
@@ -4024,6 +4029,17 @@ const groups = {
|
|
|
4024
4029
|
}
|
|
4025
4030
|
}
|
|
4026
4031
|
},
|
|
4032
|
+
fatalError: {
|
|
4033
|
+
weight: 50,
|
|
4034
|
+
packages: {
|
|
4035
|
+
nuVal: {
|
|
4036
|
+
'Cannot recover after last error. Any further errors will be ignored.': {
|
|
4037
|
+
quality: 1,
|
|
4038
|
+
what: 'Testing was interrupted by a fatal error'
|
|
4039
|
+
}
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4027
4043
|
};
|
|
4028
4044
|
|
|
4029
4045
|
// VARIABLES
|
|
@@ -4433,19 +4449,21 @@ exports.scorer = async report => {
|
|
|
4433
4449
|
// For each package with any scores:
|
|
4434
4450
|
Object.keys(packageDetails).forEach(packageName => {
|
|
4435
4451
|
const matchers = testMatchers[packageName];
|
|
4452
|
+
let testClass = '';
|
|
4436
4453
|
// For each test with any scores in the package:
|
|
4437
4454
|
Object.keys(packageDetails[packageName]).forEach(testID => {
|
|
4438
|
-
//
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4455
|
+
// Determine whether the test is in a group.
|
|
4456
|
+
let groupName = testGroups[packageName][testID];
|
|
4457
|
+
// If not:
|
|
4458
|
+
if (! groupName) {
|
|
4459
|
+
// Determine whether the package has test classes and the class is in a group.
|
|
4460
|
+
testClass = matchers && matchers.find(matcher => matcher.test(testID));
|
|
4461
|
+
if (testClass) {
|
|
4462
|
+
testID = testClass.source;
|
|
4463
|
+
groupName = testGroups[packageName][testID];
|
|
4445
4464
|
}
|
|
4446
4465
|
}
|
|
4447
|
-
// If the test is in a group:
|
|
4448
|
-
const groupName = testGroups[packageName][testID];
|
|
4466
|
+
// If the test or its class is in a group:
|
|
4449
4467
|
if (groupName) {
|
|
4450
4468
|
// Determine the preweighted or group-weighted score.
|
|
4451
4469
|
if (! groupDetails.groups[groupName]) {
|
|
@@ -4467,6 +4485,10 @@ exports.scorer = async report => {
|
|
|
4467
4485
|
score: roundedScore,
|
|
4468
4486
|
what: groups[groupName].packages[packageName][testID].what
|
|
4469
4487
|
};
|
|
4488
|
+
}
|
|
4489
|
+
// Otherwise, if the package has varying test names and the test belongs to a class:
|
|
4490
|
+
else if (matchers && (testCode = matchers.find(matcher => matcher.test(testID)))) {
|
|
4491
|
+
|
|
4470
4492
|
}
|
|
4471
4493
|
// Otherwise, i.e. if the test is solo:
|
|
4472
4494
|
else {
|