@sa11y/jest 6.4.0 → 6.5.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.
@@ -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;CAC1B,CAAC;AAcF,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,CA4C9F;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAE,aAAoC,GAAG,IAAI,CAQ7F"}
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;CAC1B,CAAC;AAcF,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,CAkD9F;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAE,aAAoC,GAAG,IAAI,CAQ7F"}
package/dist/automatic.js CHANGED
@@ -57,7 +57,7 @@ async function automaticCheck(opts = defaultAutoCheckOpts) {
57
57
  (0, common_1.log)('Skipping automatic accessibility check as Jest fake timer is in use.');
58
58
  return;
59
59
  }
60
- const violations = [];
60
+ let violations = [];
61
61
  const currentDocumentHtml = document.body.innerHTML;
62
62
  if (originalDocumentBodyHtml) {
63
63
  document.body.innerHTML = originalDocumentBodyHtml;
@@ -90,6 +90,9 @@ async function automaticCheck(opts = defaultAutoCheckOpts) {
90
90
  // TODO (spike): Disable stack trace for automatic checks.
91
91
  // Will this affect all errors globally?
92
92
  // Error.stackTraceLimit = 0;
93
+ if (process.env.SELECTOR_FILTER_KEYWORDS) {
94
+ violations = (0, format_1.exceptionListFilterSelectorKeywords)(violations, process.env.SELECTOR_FILTER_KEYWORDS.split(','));
95
+ }
93
96
  format_1.A11yError.checkAndThrow(violations, { deduplicate: opts.consolidateResults });
94
97
  }
95
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AACjE,OAAO,EACH,aAAa,EAIhB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,aAAa,UAiBzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,aAAa,EAAE,aAAa,CAAC;CAKhC,CAAC;AAkCF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,GAAE,SAA4B,GAAG,IAAI,CA4C9D;AACD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AACD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,CAIhG;AACD,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,WAAgB,GAAG,UAAU,CAK3F"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAwB,MAAM,eAAe,CAAC;AACjE,OAAO,EACH,aAAa,EAIhB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,aAAa,UAiBzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,aAAa,EAAE,aAAa,CAAC;CAKhC,CAAC;AAkCF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,GAAE,SAA4B,GAAG,IAAI,CA4C9D;AACD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AACD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,CAKhG;AACD,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,WAAgB,GAAG,UAAU,CAM3F"}
package/dist/setup.js CHANGED
@@ -124,6 +124,7 @@ exports.registerSa11yMatcher = registerSa11yMatcher;
124
124
  function adaptA11yConfigCustomRules(config, customRules) {
125
125
  const adaptedConfig = JSON.parse(JSON.stringify(config));
126
126
  adaptedConfig.runOnly.values = customRules;
127
+ adaptedConfig.ancestry = true;
127
128
  return adaptedConfig;
128
129
  }
129
130
  exports.adaptA11yConfigCustomRules = adaptA11yConfigCustomRules;
@@ -131,6 +132,7 @@ function adaptA11yConfig(config, filterRules = exports.disabledRules) {
131
132
  // TODO (refactor): Move into preset-rules pkg as a generic rules filter util
132
133
  const adaptedConfig = JSON.parse(JSON.stringify(config));
133
134
  adaptedConfig.runOnly.values = config.runOnly.values.filter((rule) => !filterRules.includes(rule));
135
+ adaptedConfig.ancestry = true;
134
136
  return adaptedConfig;
135
137
  }
136
138
  exports.adaptA11yConfig = adaptA11yConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sa11y/jest",
3
- "version": "6.4.0",
3
+ "version": "6.5.1",
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.4.0",
28
- "@sa11y/format": "6.4.0",
29
- "@sa11y/preset-rules": "6.4.0",
27
+ "@sa11y/assert": "6.5.1",
28
+ "@sa11y/format": "6.5.1",
29
+ "@sa11y/preset-rules": "6.5.1",
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.4.0",
38
- "@sa11y/test-utils": "6.4.0"
37
+ "@sa11y/common": "6.5.1",
38
+ "@sa11y/test-utils": "6.5.1"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": "^16 || ^18"
45
45
  },
46
- "gitHead": "5d4b0fb506c8bb9ddf50173112d1bacf3117d639"
46
+ "gitHead": "66e5cb2603ce047f133621d22cde9c8cd7378170"
47
47
  }