Skip to content

Commit e1abe16

Browse files
authored
feat(axe-core-4.3.2): Upgrade to use axe-core 4.3.2 (#677)
update to axe-core 4.3.2
1 parent 64da790 commit e1abe16

18 files changed

+85694
-183
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The [microsoft/axe-pipelines-samples](https://github.com/microsoft/axe-pipelines
6666
6767
The version number of this library is **independent** from the version numbers of the axe-core inputs and SARIF outputs it supports.
6868
69-
- axe-sarif-converter version 2.x supports input from version ^3.2.0 || ^4.0.0 of axe-core (tested with 3.2.2, 3.3.2, 3.4.1, 3.4.2, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 4.0.1, 4.0.2, 4.1.1, and 4.2.0) and outputs SARIF v2.1
69+
- axe-sarif-converter version 2.x supports input from version ^3.2.0 || ^4.0.0 of axe-core (tested with 3.2.2, 3.3.2, 3.4.1, 3.4.2, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 4.0.1, 4.0.2, 4.1.1, 4.2.0, and 4.3.2) and outputs SARIF v2.1
7070
- axe-sarif-converter version 1.x supports input from version >= 3.2.0 < 3.3.0 of axe-core (tested with 3.2.2) and outputs SARIF v2.0
7171
7272
Note that the SARIF format _does not use semantic versioning_, and there are breaking changes between the v2.0 and v2.1 SARIF formats. If you need compatibility with a SARIF viewer that only supports v2.0, you should use version 1.x of this library.
@@ -102,7 +102,7 @@ change, so we're waiting to change this until we would need to make a breaking c
102102
103103
To update the package and test cases to account for a new axe-core version:
104104
105-
1. Update the version of axe-core in `yarn.lock` (_not_ `package.json`); usually dependabot will cover this.
105+
1. Update the version of axe-core in `yarn.lock` (_not_ `package.json`); usually dependabot will cover this. If updating to the latest version, this can be accomplished using `yarn upgrade axe-core`.
106106
1. Build the repo with:
107107
```
108108
yarn install

src/__snapshots__/index.test.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -1388,15 +1388,15 @@ Object {
13881388
],
13891389
"tool": Object {
13901390
"driver": Object {
1391-
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.2.0",
1392-
"fullName": "axe for Web v4.2.0",
1391+
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.3.2",
1392+
"fullName": "axe for Web v4.3.2",
13931393
"informationUri": "https://www.deque.com/axe/axe-for-web/",
13941394
"name": "axe-core",
13951395
"properties": Object {
13961396
"microsoft/qualityDomain": "Accessibility",
13971397
},
13981398
"rules": Array [],
1399-
"semanticVersion": "4.2.0",
1399+
"semanticVersion": "4.3.2",
14001400
"shortDescription": Object {
14011401
"text": "An open source accessibility rules library for automated testing.",
14021402
},
@@ -1407,7 +1407,7 @@ Object {
14071407
"name": "WCAG",
14081408
},
14091409
],
1410-
"version": "4.2.0",
1410+
"version": "4.3.2",
14111411
},
14121412
},
14131413
},

src/cli.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ describe('axe-sarif-converter CLI', () => {
6767
${'w3citylights-axe-v4.1.1.axe-cli-v4.1.0.json'}
6868
${'basic-axe-v4.2.0.axe-cli-v4.1.1.json'}
6969
${'w3citylights-axe-v4.2.0.axe-cli-v4.1.1.json'}
70+
${'basic-axe-v4.3.2.axe-cli-v4.2.2.json'}
71+
${'w3citylights-axe-v4.3.2.axe-cli-v4.2.2.json'}
7072
`(
7173
'supports conversion from axe-cli output $inputFile',
7274
async ({ inputFile }) => {
@@ -185,11 +187,11 @@ describe('axe-sarif-converter CLI', () => {
185187
const testResultsDir = path.join(__dirname, '..', 'test-results');
186188
const basicAxeV2File = path.join(
187189
testResourcesDir,
188-
'basic-axe-v4.2.0.reporter-v2.json',
190+
'basic-axe-v4.3.2.reporter-v2.json',
189191
);
190192
const basicSarifFile = path.join(
191193
testResourcesDir,
192-
'basic-axe-v4.2.0.sarif',
194+
'basic-axe-v4.3.2.sarif',
193195
);
194196

195197
const mkdir = promisify(fs.mkdir);

src/index.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ describe('public convertAxeToSarif API', () => {
9999
${'basic-axe-v4.2.0.reporter-v2.json'} | ${'basic-axe-v4.2.0.sarif'}
100100
${'w3citylights-axe-v4.2.0.reporter-v1.json'} | ${'w3citylights-axe-v4.2.0.sarif'}
101101
${'w3citylights-axe-v4.2.0.reporter-v2.json'} | ${'w3citylights-axe-v4.2.0.sarif'}
102+
${'basic-axe-v4.3.2.reporter-v1.json'} | ${'basic-axe-v4.3.2.sarif'}
103+
${'basic-axe-v4.3.2.reporter-v2.json'} | ${'basic-axe-v4.3.2.sarif'}
104+
${'w3citylights-axe-v4.3.2.reporter-v1.json'} | ${'w3citylights-axe-v4.3.2.sarif'}
105+
${'w3citylights-axe-v4.3.2.reporter-v2.json'} | ${'w3citylights-axe-v4.3.2.sarif'}
102106
`(
103107
'converts pinned v1/v2 input $inputFile to pinned output $outputFile',
104108
({ inputFile, outputFile }) => {
@@ -143,7 +147,7 @@ describe('public sarifReporter API', () => {
143147
// it isn't very meaningful to test cases that involve old axe versions here.
144148
it.each`
145149
inputFile | outputFile
146-
${'basic-axe-v4.2.0.reporter-raw.json'} | ${'basic-axe-v4.2.0.sarif'}
150+
${'basic-axe-v4.3.2.reporter-raw.json'} | ${'basic-axe-v4.3.2.sarif'}
147151
`(
148152
'converts pinned raw input $inputFile to pinned output $outputFile',
149153
async ({ inputFile, outputFile }) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"inapplicable": [],
4+
"incomplete": [],
5+
"passes": [],
6+
"testEngine": {
7+
"name": "axe-core",
8+
"version": "4.3.2"
9+
},
10+
"testEnvironment": {
11+
"orientationAngle": 0,
12+
"orientationType": "landscape-primary",
13+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4515.131 Safari/537.36",
14+
"windowHeight": 600,
15+
"windowWidth": 800
16+
},
17+
"testRunner": {
18+
"name": "axe"
19+
},
20+
"timestamp": "2021-08-10T23:22:50.309Z",
21+
"toolOptions": {
22+
"reporter": "v1",
23+
"runOnly": {
24+
"type": "rule",
25+
"values": [
26+
"document-title"
27+
]
28+
}
29+
},
30+
"url": "file:///C:/Users/brock/projects/axe-sarif-converter/src/test-resources/basic.html",
31+
"violations": [
32+
{
33+
"description": "Ensures each HTML document contains a non-empty <title> element",
34+
"help": "Documents must have <title> element to aid in navigation",
35+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.3/document-title?application=webdriverjs",
36+
"id": "document-title",
37+
"impact": "serious",
38+
"nodes": [
39+
{
40+
"all": [],
41+
"any": [
42+
{
43+
"data": null,
44+
"id": "doc-has-title",
45+
"impact": "serious",
46+
"message": "Document does not have a non-empty <title> element",
47+
"relatedNodes": []
48+
}
49+
],
50+
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element",
51+
"html": "<html class=\"deque-axe-is-ready\"><head></head><body>\n</body><script>document.documentElement.classList.add(\"deque-axe-is-ready\");</script></html>",
52+
"impact": "serious",
53+
"none": [],
54+
"target": [
55+
"html"
56+
]
57+
}
58+
],
59+
"tags": [
60+
"cat.text-alternatives",
61+
"wcag2a",
62+
"wcag242",
63+
"ACT"
64+
]
65+
}
66+
]
67+
}
68+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"id": "document-title",
4+
"result": "failed",
5+
"pageLevel": false,
6+
"impact": "serious",
7+
"tags": [
8+
"cat.text-alternatives",
9+
"wcag2a",
10+
"wcag242",
11+
"ACT"
12+
],
13+
"description": "Ensures each HTML document contains a non-empty <title> element",
14+
"help": "Documents must have <title> element to aid in navigation",
15+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.3/document-title?application=axe-puppeteer",
16+
"inapplicable": [],
17+
"passes": [],
18+
"incomplete": [],
19+
"violations": [
20+
{
21+
"node": {
22+
"selector": [
23+
"html"
24+
],
25+
"source": "<html><head></head><body>\n</body></html>",
26+
"xpath": [
27+
"/html"
28+
],
29+
"ancestry": [
30+
"html"
31+
],
32+
"nodeIndexes": [
33+
0
34+
]
35+
},
36+
"any": [
37+
{
38+
"id": "doc-has-title",
39+
"data": null,
40+
"relatedNodes": [],
41+
"impact": "serious",
42+
"message": "Document does not have a non-empty <title> element"
43+
}
44+
],
45+
"all": [],
46+
"none": [],
47+
"impact": "serious",
48+
"result": "failed"
49+
}
50+
]
51+
}
52+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"testEngine": {
3+
"name": "axe-core",
4+
"version": "4.3.2"
5+
},
6+
"testRunner": {
7+
"name": "axe"
8+
},
9+
"testEnvironment": {
10+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/91.0.4469.0 Safari/537.36",
11+
"windowWidth": 800,
12+
"windowHeight": 600,
13+
"orientationAngle": 0,
14+
"orientationType": "portrait-primary"
15+
},
16+
"timestamp": "2000-01-02T03:04:05.006Z",
17+
"url": "http://localhost/",
18+
"toolOptions": {
19+
"xpath": true,
20+
"runOnly": {
21+
"type": "rule",
22+
"values": [
23+
"document-title"
24+
]
25+
},
26+
"reporter": "v1"
27+
},
28+
"violations": [
29+
{
30+
"id": "document-title",
31+
"impact": "serious",
32+
"tags": [
33+
"cat.text-alternatives",
34+
"wcag2a",
35+
"wcag242",
36+
"ACT"
37+
],
38+
"description": "Ensures each HTML document contains a non-empty <title> element",
39+
"help": "Documents must have <title> element to aid in navigation",
40+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.3/document-title?application=axe-puppeteer",
41+
"nodes": [
42+
{
43+
"any": [
44+
{
45+
"id": "doc-has-title",
46+
"data": null,
47+
"relatedNodes": [],
48+
"impact": "serious",
49+
"message": "Document does not have a non-empty <title> element"
50+
}
51+
],
52+
"all": [],
53+
"none": [],
54+
"impact": "serious",
55+
"html": "<html><head></head><body>\n</body></html>",
56+
"target": [
57+
"html"
58+
],
59+
"xpath": [
60+
"/html"
61+
],
62+
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element"
63+
}
64+
]
65+
}
66+
],
67+
"passes": [],
68+
"incomplete": [],
69+
"inapplicable": []
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"testEngine": {
3+
"name": "axe-core",
4+
"version": "4.3.2"
5+
},
6+
"testRunner": {
7+
"name": "axe"
8+
},
9+
"testEnvironment": {
10+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/91.0.4469.0 Safari/537.36",
11+
"windowWidth": 800,
12+
"windowHeight": 600,
13+
"orientationAngle": 0,
14+
"orientationType": "portrait-primary"
15+
},
16+
"timestamp": "2000-01-02T03:04:05.006Z",
17+
"url": "http://localhost/",
18+
"toolOptions": {
19+
"xpath": true,
20+
"runOnly": {
21+
"type": "rule",
22+
"values": [
23+
"document-title"
24+
]
25+
},
26+
"reporter": "v2"
27+
},
28+
"violations": [
29+
{
30+
"id": "document-title",
31+
"impact": "serious",
32+
"tags": [
33+
"cat.text-alternatives",
34+
"wcag2a",
35+
"wcag242",
36+
"ACT"
37+
],
38+
"description": "Ensures each HTML document contains a non-empty <title> element",
39+
"help": "Documents must have <title> element to aid in navigation",
40+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.3/document-title?application=axe-puppeteer",
41+
"nodes": [
42+
{
43+
"any": [
44+
{
45+
"id": "doc-has-title",
46+
"data": null,
47+
"relatedNodes": [],
48+
"impact": "serious",
49+
"message": "Document does not have a non-empty <title> element"
50+
}
51+
],
52+
"all": [],
53+
"none": [],
54+
"impact": "serious",
55+
"html": "<html><head></head><body>\n</body></html>",
56+
"target": [
57+
"html"
58+
],
59+
"xpath": [
60+
"/html"
61+
]
62+
}
63+
]
64+
}
65+
],
66+
"passes": [],
67+
"incomplete": [],
68+
"inapplicable": []
69+
}

0 commit comments

Comments
 (0)