@sa11y/jest 6.1.0 → 6.1.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.
- package/dist/automatic.d.ts.map +1 -1
- package/dist/automatic.js +2 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +10 -1
- package/package.json +7 -7
package/dist/automatic.d.ts.map
CHANGED
|
@@ -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,
|
|
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,CAsC9F;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAE,aAAoC,GAAG,IAAI,CAQ7F"}
|
package/dist/automatic.js
CHANGED
|
@@ -58,6 +58,7 @@ async function automaticCheck(opts = defaultAutoCheckOpts) {
|
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
const violations = [];
|
|
61
|
+
const currentDocumentHtml = document.body.innerHTML;
|
|
61
62
|
if (originalDocumentBodyHtml) {
|
|
62
63
|
document.body.innerHTML = originalDocumentBodyHtml;
|
|
63
64
|
}
|
|
@@ -79,6 +80,7 @@ async function automaticCheck(opts = defaultAutoCheckOpts) {
|
|
|
79
80
|
}
|
|
80
81
|
finally {
|
|
81
82
|
(0, exports.setOriginalDocumentBodyHtml)(null);
|
|
83
|
+
document.body.innerHTML = currentDocumentHtml;
|
|
82
84
|
if (opts.cleanupAfterEach)
|
|
83
85
|
document.body.innerHTML = ''; // remove non-element nodes
|
|
84
86
|
// TODO (spike): Disable stack trace for automatic checks.
|
package/dist/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,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;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,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,CAoB9D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,WAAgB,GAAG,UAAU,CAK3F"}
|
package/dist/setup.js
CHANGED
|
@@ -52,12 +52,21 @@ function registerRemoveChild() {
|
|
|
52
52
|
return originalRemoveChild.call(this, oldChild);
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
+
const improvedChecksFilter = [
|
|
56
|
+
'ui-email-stream-components/modules/emailStream/adminHealthInsights/__tests__/adminHealthInsights.test.js',
|
|
57
|
+
];
|
|
55
58
|
/**
|
|
56
59
|
* Register Sa11y Jest API and automatic checks depending on {@link Sa11yOpts}
|
|
57
60
|
* @param opts - {@link Sa11yOpts} to opt-in to automatic checks
|
|
58
61
|
*/
|
|
59
62
|
function setup(opts = defaultSa11yOpts) {
|
|
60
|
-
|
|
63
|
+
if (process.env.SA11Y_AUTO) {
|
|
64
|
+
const testPath = globals_1.expect.getState().testPath ?? '';
|
|
65
|
+
const ignoreImprovedChecks = improvedChecksFilter.some((fileName) => testPath.toLowerCase().includes(fileName.toLowerCase()));
|
|
66
|
+
if (!ignoreImprovedChecks) {
|
|
67
|
+
registerRemoveChild();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
61
70
|
registerSa11yMatcher();
|
|
62
71
|
// Set defaults from env vars
|
|
63
72
|
const autoCheckOpts = opts.autoCheckOpts;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sa11y/jest",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.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.1.
|
|
28
|
-
"@sa11y/format": "6.1.
|
|
29
|
-
"@sa11y/preset-rules": "6.1.
|
|
27
|
+
"@sa11y/assert": "6.1.2",
|
|
28
|
+
"@sa11y/format": "6.1.2",
|
|
29
|
+
"@sa11y/preset-rules": "6.1.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.1.
|
|
38
|
-
"@sa11y/test-utils": "6.1.
|
|
37
|
+
"@sa11y/common": "6.1.2",
|
|
38
|
+
"@sa11y/test-utils": "6.1.2"
|
|
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": "
|
|
46
|
+
"gitHead": "b444195c9de0114566184e0cf76a3ff74be53e8a"
|
|
47
47
|
}
|