testaro-issues 0.4.1 → 0.5.0

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/dist/index.cjs CHANGED
@@ -1,5 +1,20 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/index.ts
3
+ const outcomes = ["failed", "cantTell"];
4
+ const uncertainties = [
5
+ "not-computable",
6
+ "judgement-required",
7
+ "runtime-dependent",
8
+ "spec-only",
9
+ "equivalence-unknown",
10
+ "out-of-scope"
11
+ ];
12
+ const whyIgnore = [
13
+ "invalid",
14
+ "irrelevant",
15
+ "duplicative",
16
+ "unreliable"
17
+ ];
3
18
  const issuesData = {
4
19
  "ignorable": {
5
20
  "summary": "ignorable",
@@ -9747,7 +9762,7 @@ const rules = deepFreeze(rulesData);
9747
9762
  const makeIssueRules = (ruleTable, issueTable = issues) => {
9748
9763
  const errors = [];
9749
9764
  const checkEntry = (engineID, variabilityName, ruleID, entry, engineRuleIDs) => {
9750
- const { issueID, quality, what, supersededBy } = entry;
9765
+ const { issueID, quality, what, supersededBy, outcome, uncertainty, review, ignore } = entry;
9751
9766
  if (!ruleID.length) errors.push(`${engineID}.${variabilityName} has a rule with an empty ruleID`);
9752
9767
  if (typeof issueID !== "string" || !issueID.length || !(issueID in issueTable)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid issueID (${JSON.stringify(issueID)})`);
9753
9768
  if (typeof quality !== "number") errors.push(`${engineID}.${variabilityName}.${ruleID} has a non-numeric quality (${JSON.stringify(quality)})`);
@@ -9757,6 +9772,10 @@ const makeIssueRules = (ruleTable, issueTable = issues) => {
9757
9772
  else if (supersededBy === ruleID) errors.push(`${engineID}.${variabilityName}.${ruleID} has supersededBy naming itself`);
9758
9773
  else if (!engineRuleIDs.has(supersededBy)) errors.push(`${engineID}.${variabilityName}.${ruleID} has supersededBy (${supersededBy}), which is not a rule of ${engineID}`);
9759
9774
  }
9775
+ if (outcome !== void 0 && !outcomes.includes(outcome)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid outcome (${JSON.stringify(outcome)})`);
9776
+ if (uncertainty !== void 0 && !uncertainties.includes(uncertainty)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid uncertainty (${JSON.stringify(uncertainty)})`);
9777
+ if (review !== void 0 && (typeof review !== "string" || !review.length)) errors.push(`${engineID}.${variabilityName}.${ruleID} has a non-string or empty review (${JSON.stringify(review)})`);
9778
+ if (ignore !== void 0 && !whyIgnore.includes(ignore)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid ignore (${JSON.stringify(ignore)})`);
9760
9779
  if (variabilityName === "variable") {
9761
9780
  if (!/[.*+?^${}()|[\]\\]/.test(ruleID)) errors.push(`${engineID}.${variabilityName}.${ruleID} has no regex metacharacters, so it should be an invariant rule`);
9762
9781
  else try {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,12 @@
1
1
  //#region src/index.d.ts
2
+ declare const outcomes: readonly ['failed', 'cantTell'];
3
+ declare const uncertainties: readonly ['not-computable', 'judgement-required', 'runtime-dependent', 'spec-only', 'equivalence-unknown', 'out-of-scope'];
4
+ declare const whyIgnore: readonly ['invalid', 'irrelevant', 'duplicative', 'unreliable'];
2
5
  type IssueID = keyof typeof issuesData;
3
6
  type IssueEngineRuleCounts = Record<string, number>;
7
+ type Outcome = typeof outcomes[number];
8
+ type Uncertainty = typeof uncertainties[number];
9
+ type Ignore = typeof whyIgnore[number];
4
10
  interface Issue {
5
11
  summary: string;
6
12
  why: string;
@@ -17,6 +23,10 @@ interface RuleEntry {
17
23
  quality: number;
18
24
  what: string;
19
25
  supersededBy?: string | null;
26
+ outcome?: Outcome;
27
+ uncertainty?: Uncertainty;
28
+ review?: string;
29
+ ignore?: Ignore;
20
30
  }
21
31
  interface EngineRules {
22
32
  invariant: Record<string, RuleEntry>;
@@ -2279,4 +2289,4 @@ declare const getEngineRuleCounts: (ruleTable?: Record<string, EngineRules>) =>
2279
2289
  declare const issueRules: Record<string, Record<string, ruleIDsByType>>;
2280
2290
  declare const issueStats: Record<string, IssueEngineRuleCounts>;
2281
2291
  //#endregion
2282
- export { IssueEngineRuleCounts, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
2292
+ export { Ignore, IssueEngineRuleCounts, Outcome, Uncertainty, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,12 @@
1
1
  //#region src/index.d.ts
2
+ declare const outcomes: readonly ['failed', 'cantTell'];
3
+ declare const uncertainties: readonly ['not-computable', 'judgement-required', 'runtime-dependent', 'spec-only', 'equivalence-unknown', 'out-of-scope'];
4
+ declare const whyIgnore: readonly ['invalid', 'irrelevant', 'duplicative', 'unreliable'];
2
5
  type IssueID = keyof typeof issuesData;
3
6
  type IssueEngineRuleCounts = Record<string, number>;
7
+ type Outcome = typeof outcomes[number];
8
+ type Uncertainty = typeof uncertainties[number];
9
+ type Ignore = typeof whyIgnore[number];
4
10
  interface Issue {
5
11
  summary: string;
6
12
  why: string;
@@ -17,6 +23,10 @@ interface RuleEntry {
17
23
  quality: number;
18
24
  what: string;
19
25
  supersededBy?: string | null;
26
+ outcome?: Outcome;
27
+ uncertainty?: Uncertainty;
28
+ review?: string;
29
+ ignore?: Ignore;
20
30
  }
21
31
  interface EngineRules {
22
32
  invariant: Record<string, RuleEntry>;
@@ -2279,4 +2289,4 @@ declare const getEngineRuleCounts: (ruleTable?: Record<string, EngineRules>) =>
2279
2289
  declare const issueRules: Record<string, Record<string, ruleIDsByType>>;
2280
2290
  declare const issueStats: Record<string, IssueEngineRuleCounts>;
2281
2291
  //#endregion
2282
- export { IssueEngineRuleCounts, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
2292
+ export { Ignore, IssueEngineRuleCounts, Outcome, Uncertainty, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
package/dist/index.mjs CHANGED
@@ -1,4 +1,19 @@
1
1
  //#region src/index.ts
2
+ const outcomes = ["failed", "cantTell"];
3
+ const uncertainties = [
4
+ "not-computable",
5
+ "judgement-required",
6
+ "runtime-dependent",
7
+ "spec-only",
8
+ "equivalence-unknown",
9
+ "out-of-scope"
10
+ ];
11
+ const whyIgnore = [
12
+ "invalid",
13
+ "irrelevant",
14
+ "duplicative",
15
+ "unreliable"
16
+ ];
2
17
  const issuesData = {
3
18
  "ignorable": {
4
19
  "summary": "ignorable",
@@ -9746,7 +9761,7 @@ const rules = deepFreeze(rulesData);
9746
9761
  const makeIssueRules = (ruleTable, issueTable = issues) => {
9747
9762
  const errors = [];
9748
9763
  const checkEntry = (engineID, variabilityName, ruleID, entry, engineRuleIDs) => {
9749
- const { issueID, quality, what, supersededBy } = entry;
9764
+ const { issueID, quality, what, supersededBy, outcome, uncertainty, review, ignore } = entry;
9750
9765
  if (!ruleID.length) errors.push(`${engineID}.${variabilityName} has a rule with an empty ruleID`);
9751
9766
  if (typeof issueID !== "string" || !issueID.length || !(issueID in issueTable)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid issueID (${JSON.stringify(issueID)})`);
9752
9767
  if (typeof quality !== "number") errors.push(`${engineID}.${variabilityName}.${ruleID} has a non-numeric quality (${JSON.stringify(quality)})`);
@@ -9756,6 +9771,10 @@ const makeIssueRules = (ruleTable, issueTable = issues) => {
9756
9771
  else if (supersededBy === ruleID) errors.push(`${engineID}.${variabilityName}.${ruleID} has supersededBy naming itself`);
9757
9772
  else if (!engineRuleIDs.has(supersededBy)) errors.push(`${engineID}.${variabilityName}.${ruleID} has supersededBy (${supersededBy}), which is not a rule of ${engineID}`);
9758
9773
  }
9774
+ if (outcome !== void 0 && !outcomes.includes(outcome)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid outcome (${JSON.stringify(outcome)})`);
9775
+ if (uncertainty !== void 0 && !uncertainties.includes(uncertainty)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid uncertainty (${JSON.stringify(uncertainty)})`);
9776
+ if (review !== void 0 && (typeof review !== "string" || !review.length)) errors.push(`${engineID}.${variabilityName}.${ruleID} has a non-string or empty review (${JSON.stringify(review)})`);
9777
+ if (ignore !== void 0 && !whyIgnore.includes(ignore)) errors.push(`${engineID}.${variabilityName}.${ruleID} has an invalid ignore (${JSON.stringify(ignore)})`);
9759
9778
  if (variabilityName === "variable") {
9760
9779
  if (!/[.*+?^${}()|[\]\\]/.test(ruleID)) errors.push(`${engineID}.${variabilityName}.${ruleID} has no regex metacharacters, so it should be an invariant rule`);
9761
9780
  else try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro-issues",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "A classification of about 1500 rules of 10 rule engines into about 400 issues. The rule engines are those in the ensemble of Testaro, which tests web pages for front-end quality (accessibility, usability, and standards conformance).",
6
6
  "main": "./dist/index.cjs",