@sa11y/jest 6.10.1 → 6.10.2-alpha.2

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 +1 @@
1
- {"version":3,"file":"automatic.d.ts","sourceRoot":"","sources":["../src/automatic.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAI7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAiBF,eAAO,MAAM,2BAA2B,aAAc,MAAM,GAAG,IAAI,SAElE,CAAC;AAEF,eAAO,MAAM,2BAA2B,qBAEvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAUtF;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,GAAE,aAAoC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiF9F;AAsBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAE,aAAoC,GAAG,IAAI,CAmB7F"}
1
+ {"version":3,"file":"automatic.d.ts","sourceRoot":"","sources":["../src/automatic.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAI7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAiBF,eAAO,MAAM,2BAA2B,aAAc,MAAM,GAAG,IAAI,SAElE,CAAC;AAEF,eAAO,MAAM,2BAA2B,qBAEvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAUtF;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,GAAE,aAAoC,GAAG,OAAO,CAAC,IAAI,CAAC,CAsF9F;AAsBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAE,aAAoC,GAAG,IAAI,CAmB7F"}
package/dist/automatic.js CHANGED
@@ -103,6 +103,12 @@ async function automaticCheck(opts = defaultAutoCheckOpts) {
103
103
  }
104
104
  }
105
105
  }
106
+ catch (e) {
107
+ // TODO - remove after validation on custom ruleset AB
108
+ if (process.env.SA11Y_CUSTOM_RULES) {
109
+ format_1.AxeError.throwAxeError(e);
110
+ }
111
+ }
106
112
  finally {
107
113
  if (opts.runDOMMutationObserver) {
108
114
  mutatedNodes = [];
@@ -1 +1 @@
1
- {"version":3,"file":"groupViolationResultsProcessor.d.ts","sourceRoot":"","sources":["../src/groupViolationResultsProcessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AA6MlF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAa5E;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAaxF"}
1
+ {"version":3,"file":"groupViolationResultsProcessor.d.ts","sourceRoot":"","sources":["../src/groupViolationResultsProcessor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AA4NlF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAa5E;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAaxF"}
@@ -129,8 +129,10 @@ For guidance on accessibility related specifics, contact our A11y team: http://s
129
129
  */
130
130
  function processA11yErrors(results, testSuite, testResult) {
131
131
  const a11yFailureDetails = [];
132
+ const axeFailureDetails = [];
132
133
  const a11yFailureMessages = [];
133
- let a11yErrorsExist = false;
134
+ const axeFailureMessages = [];
135
+ let a11yAxeErrorsExist = false;
134
136
  testResult.failureDetails.forEach((failure) => {
135
137
  let error = failure.error;
136
138
  // If using circus test runner https://github.com/facebook/jest/issues/11405#issuecomment-843549606
@@ -139,20 +141,28 @@ function processA11yErrors(results, testSuite, testResult) {
139
141
  if (error === undefined)
140
142
  error = failure;
141
143
  if (error.name === format_1.A11yError.name) {
142
- a11yErrorsExist = true;
144
+ a11yAxeErrorsExist = true;
143
145
  a11yFailureDetails.push({ ...failure });
144
146
  processA11yDetailsAndMessages(error, a11yFailureMessages);
145
147
  }
148
+ if (error.name === format_1.AxeError.name) {
149
+ a11yAxeErrorsExist = true;
150
+ axeFailureDetails.push({ ...failure });
151
+ axeFailureMessages.push(`
152
+ The test has failed to execute the accessibility check.
153
+ Please contact our Sa11y team: http://sfdc.co/sa11y-users
154
+ `);
155
+ }
146
156
  });
147
- if (!a11yErrorsExist) {
157
+ if (!a11yAxeErrorsExist) {
148
158
  testSuite.numFailingTests -= 1;
149
159
  results.numFailedTests -= 1;
150
160
  if (testSuite.numFailingTests === 0)
151
161
  results.numFailedTestSuites -= 1;
152
162
  }
153
- testResult.failureDetails = [...a11yFailureDetails];
154
- testResult.failureMessages = [...a11yFailureMessages];
155
- testResult.status = a11yFailureDetails.length === 0 ? 'passed' : testResult.status;
163
+ testResult.failureDetails = [...a11yFailureDetails, ...axeFailureDetails];
164
+ testResult.failureMessages = [...a11yFailureMessages, ...axeFailureMessages];
165
+ testResult.status = testResult.failureDetails.length === 0 ? 'passed' : testResult.status;
156
166
  }
157
167
  function processA11yMatcherErrors(results, testSuite, testResult) {
158
168
  const a11yFailureMessages = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sa11y/jest",
3
- "version": "6.10.1",
3
+ "version": "6.10.2-alpha.2",
4
4
  "description": "Accessibility testing matcher for Jest",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://github.com/salesforce/sa11y/tree/master/packages/jest#readme",
@@ -24,9 +24,9 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@jest/test-result": "^27",
27
- "@sa11y/assert": "6.10.1",
28
- "@sa11y/format": "6.10.1",
29
- "@sa11y/preset-rules": "6.10.1",
27
+ "@sa11y/assert": "6.10.2-alpha.2",
28
+ "@sa11y/format": "6.10.2-alpha.2",
29
+ "@sa11y/preset-rules": "6.10.2-alpha.2",
30
30
  "jest-matcher-utils": "^27"
31
31
  },
32
32
  "peerDependencies": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@jest/globals": "28.1.3",
37
- "@sa11y/common": "6.10.1",
38
- "@sa11y/test-utils": "6.10.1"
37
+ "@sa11y/common": "6.10.2-alpha.2",
38
+ "@sa11y/test-utils": "6.10.2-alpha.2"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": "^16 || ^18 || ^20"
45
45
  },
46
- "gitHead": "a3e1f7bfe5aeea4a4aa70d2726cc608e92ecf366"
46
+ "gitHead": "63a1226f6207fea4e7b5025f60a2de7392b541e3"
47
47
  }