@axe-core/cli 4.8.0 → 4.8.1-5bfd440.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.
Files changed (63) hide show
  1. package/dist/package.json +91 -0
  2. package/dist/src/bin/cli.d.ts +2 -0
  3. package/dist/src/bin/cli.js +40 -0
  4. package/dist/src/bin/cli.js.map +1 -0
  5. package/dist/src/bin/cli.test.d.ts +1 -0
  6. package/dist/src/bin/cli.test.js +259 -0
  7. package/dist/src/bin/cli.test.js.map +1 -0
  8. package/dist/src/bin/index.d.ts +5 -0
  9. package/dist/src/bin/index.js +168 -0
  10. package/dist/src/bin/index.js.map +1 -0
  11. package/dist/src/lib/axe-test-urls.d.ts +4 -0
  12. package/dist/src/lib/axe-test-urls.js +89 -0
  13. package/dist/src/lib/axe-test-urls.js.map +1 -0
  14. package/dist/src/lib/axe-test-urls.test.d.ts +1 -0
  15. package/dist/src/lib/axe-test-urls.test.js +73 -0
  16. package/dist/src/lib/axe-test-urls.test.js.map +1 -0
  17. package/dist/src/lib/events.d.ts +10 -0
  18. package/dist/src/lib/events.js +54 -0
  19. package/dist/src/lib/events.js.map +1 -0
  20. package/dist/src/lib/events.test.d.ts +1 -0
  21. package/dist/src/lib/events.test.js +31 -0
  22. package/dist/src/lib/events.test.js.map +1 -0
  23. package/{src/lib/index.ts → dist/src/lib/index.d.ts} +0 -1
  24. package/dist/src/lib/index.js +36 -0
  25. package/dist/src/lib/index.js.map +1 -0
  26. package/dist/src/lib/utils.d.ts +15 -0
  27. package/dist/src/lib/utils.js +127 -0
  28. package/dist/src/lib/utils.js.map +1 -0
  29. package/dist/src/lib/utils.test.d.ts +1 -0
  30. package/dist/src/lib/utils.test.js +165 -0
  31. package/dist/src/lib/utils.test.js.map +1 -0
  32. package/dist/src/lib/webdriver.d.ts +4 -0
  33. package/dist/src/lib/webdriver.js +50 -0
  34. package/dist/src/lib/webdriver.js.map +1 -0
  35. package/dist/src/lib/webdriver.test.d.ts +1 -0
  36. package/dist/src/lib/webdriver.test.js +102 -0
  37. package/dist/src/lib/webdriver.test.js.map +1 -0
  38. package/dist/src/testutils/index.d.ts +19 -0
  39. package/dist/src/testutils/index.js +51 -0
  40. package/dist/src/testutils/index.js.map +1 -0
  41. package/dist/src/types.d.ts +37 -0
  42. package/dist/src/types.js +18 -0
  43. package/dist/src/types.js.map +1 -0
  44. package/package.json +7 -3
  45. package/.eslintrc.js +0 -18
  46. package/CHANGELOG.md +0 -221
  47. package/src/bin/cli.test.ts +0 -420
  48. package/src/bin/cli.ts +0 -86
  49. package/src/bin/index.ts +0 -216
  50. package/src/lib/axe-test-urls.test.ts +0 -73
  51. package/src/lib/axe-test-urls.ts +0 -98
  52. package/src/lib/events.test.ts +0 -26
  53. package/src/lib/events.ts +0 -68
  54. package/src/lib/utils.test.ts +0 -160
  55. package/src/lib/utils.ts +0 -147
  56. package/src/lib/webdriver.test.ts +0 -104
  57. package/src/lib/webdriver.ts +0 -43
  58. package/src/testutils/axe-core@2.5.0.js +0 -18929
  59. package/src/testutils/index.ts +0 -47
  60. package/src/testutils/simple-clean.html +0 -11
  61. package/src/testutils/simple.html +0 -12
  62. package/src/types.ts +0 -42
  63. package/tsconfig.json +0 -19
package/CHANGELOG.md DELETED
@@ -1,221 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [4.8.0](https://github.com/dequelabs/axe-core-npm/compare/v4.7.3...v4.8.0) (2023-09-28)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **cli:** better error message for ChromeDriver version mismatch ([#680](https://github.com/dequelabs/axe-core-npm/issues/680)) ([10cf350](https://github.com/dequelabs/axe-core-npm/commit/10cf3509449587a14799fb168678258249bc1900)), closes [#679](https://github.com/dequelabs/axe-core-npm/issues/679)
12
- * **cli:** improve error message on script timeout ([#681](https://github.com/dequelabs/axe-core-npm/issues/681)) ([b407c6c](https://github.com/dequelabs/axe-core-npm/commit/b407c6cf1f8a980fc036b75c7b3f7198d3bb556c))
13
- * **cli:** respect --exit regardless of other flags ([#750](https://github.com/dequelabs/axe-core-npm/issues/750)) ([bfa2328](https://github.com/dequelabs/axe-core-npm/commit/bfa232800d553d870933e5dfa26d669d2d566c08))
14
- * pin axe-core version to accept patch updates only ([#838](https://github.com/dequelabs/axe-core-npm/issues/838)) ([2456ed6](https://github.com/dequelabs/axe-core-npm/commit/2456ed641781c2262bf71db24f7f97755422d5f6))
15
-
16
-
17
- ### Features
18
-
19
- * **cli:** add --chrome-path option ([#700](https://github.com/dequelabs/axe-core-npm/issues/700)) ([#704](https://github.com/dequelabs/axe-core-npm/issues/704)) ([ada5d28](https://github.com/dequelabs/axe-core-npm/commit/ada5d28ccbbf9121f9d1fb5172347019c2ae63d1))
20
- * Update axe-core to v4.8.2 ([#835](https://github.com/dequelabs/axe-core-npm/issues/835)) ([2ac1eaf](https://github.com/dequelabs/axe-core-npm/commit/2ac1eafa6318453003ccfd7c33625e63725a7c00))
21
-
22
-
23
-
24
-
25
-
26
- ## [4.7.3](https://github.com/dequelabs/axe-core-npm/compare/v4.7.2...v4.7.3) (2023-06-09)
27
-
28
- **Note:** Version bump only for package @axe-core/cli
29
-
30
- ## [4.7.2](https://github.com/dequelabs/axe-core-npm/compare/v4.7.1...v4.7.2) (2023-06-01)
31
-
32
- ### Bug Fixes
33
-
34
- - **packages/cli:** revert ESM ([#730](https://github.com/dequelabs/axe-core-npm/issues/730)) ([4e1fb95](https://github.com/dequelabs/axe-core-npm/commit/4e1fb958fa251db7eea3433f91f2a2f3adbda1e8))
35
-
36
- ## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)
37
-
38
- **Note:** Version bump only for package @axe-core/cli
39
-
40
- # [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)
41
-
42
- ### Bug Fixes
43
-
44
- - **cli:** do not inject script tags due to pages not allowing script tags ([#710](https://github.com/dequelabs/axe-core-npm/issues/710)) ([2e0fdb4](https://github.com/dequelabs/axe-core-npm/commit/2e0fdb4a4661040b9b8dbb91bed1a96142e4fe0c))
45
-
46
- ### Features
47
-
48
- - enable esm import ([#713](https://github.com/dequelabs/axe-core-npm/issues/713)) ([076bfa9](https://github.com/dequelabs/axe-core-npm/commit/076bfa99f27f416b4eaff6d24cc23e8573fc72ee))
49
- - Update axe-core to v4.7.0 ([#709](https://github.com/dequelabs/axe-core-npm/issues/709)) ([d418d09](https://github.com/dequelabs/axe-core-npm/commit/d418d093b4c462d5d60e0f7ad3d5147bcaf52aa2))
50
-
51
- ## [4.6.1](https://github.com/dequelabs/axe-core-npm/compare/v4.6.0...v4.6.1) (2023-03-28)
52
-
53
- ### Bug Fixes
54
-
55
- - **cli:** increase --timeout default to 90 seconds (to match --help) ([#683](https://github.com/dequelabs/axe-core-npm/issues/683)) ([d11481b](https://github.com/dequelabs/axe-core-npm/commit/d11481b8c74598617260586fe14c8ceba32c6792))
56
- - Update axe-core to v4.6.3 ([#698](https://github.com/dequelabs/axe-core-npm/issues/698)) ([a7d53a4](https://github.com/dequelabs/axe-core-npm/commit/a7d53a4876237c74bb8dc2836b703cdaf2f7ace5))
57
-
58
- # [4.6.0](https://github.com/dequelabs/axe-core-npm/compare/v4.5.2...v4.6.0) (2023-01-19)
59
-
60
- ### Features
61
-
62
- - support shadow dom selectors ([#619](https://github.com/dequelabs/axe-core-npm/issues/619)) ([6065b56](https://github.com/dequelabs/axe-core-npm/commit/6065b562adf289341033a7233426ba3dcfb8a24b))
63
- - Update axe-core to v4.6.1 ([#633](https://github.com/dequelabs/axe-core-npm/issues/633)) ([8bab5b2](https://github.com/dequelabs/axe-core-npm/commit/8bab5b23b3653a6a0603f10d889e22418a4fff3e))
64
-
65
- ## [4.5.2](https://github.com/dequelabs/axe-core-npm/compare/v4.5.1...v4.5.2) (2022-11-15)
66
-
67
- ### Bug Fixes
68
-
69
- - **cli:** include all functions in types file ([#603](https://github.com/dequelabs/axe-core-npm/issues/603)) ([30042ef](https://github.com/dequelabs/axe-core-npm/commit/30042ef3acc0cab7f67ddcf284df089f243f53e6))
70
- - **cli:** use correct driver typings ([#604](https://github.com/dequelabs/axe-core-npm/issues/604)) ([d33bbdf](https://github.com/dequelabs/axe-core-npm/commit/d33bbdf2b3d05c3ba0106d717ba1c8d706c5e05c))
71
- - update to use axe-core 4.5.2 ([#607](https://github.com/dequelabs/axe-core-npm/issues/607)) ([61312ff](https://github.com/dequelabs/axe-core-npm/commit/61312fff2e9ee4e0f218a29a1608f69b45206fad))
72
-
73
- ## [4.5.1](https://github.com/dequelabs/axe-core-npm/compare/v4.5.0...v4.5.1) (2022-11-03)
74
-
75
- ### Bug Fixes
76
-
77
- - update to use axe-core 4.5.1 ([#597](https://github.com/dequelabs/axe-core-npm/issues/597)) ([173bf05](https://github.com/dequelabs/axe-core-npm/commit/173bf0521fafc2be092bf61523e05cf3aab1de75))
78
-
79
- # [4.5.0](https://github.com/dequelabs/axe-core-npm/compare/v4.4.5...v4.5.0) (2022-10-26)
80
-
81
- ### Features
82
-
83
- - upgrade to use axe-core@4.5.0 ([#589](https://github.com/dequelabs/axe-core-npm/issues/589)) ([4343d9d](https://github.com/dequelabs/axe-core-npm/commit/4343d9d633036ee10198f2a9b757de29b240624e))
84
-
85
- ## [4.4.5](https://github.com/dequelabs/axe-core-npm/compare/v4.4.4...v4.4.5) (2022-09-26)
86
-
87
- ### Bug Fixes
88
-
89
- - **cli:** display stack trace on errors by default ([#555](https://github.com/dequelabs/axe-core-npm/issues/555)) ([a47100c](https://github.com/dequelabs/axe-core-npm/commit/a47100cc74ba3edc76bf49d4e6a7cba39a19a4ac))
90
- - provide proper typings for axe-cli ([#559](https://github.com/dequelabs/axe-core-npm/issues/559)) ([e4ccfa5](https://github.com/dequelabs/axe-core-npm/commit/e4ccfa5c404a0a2156008d5b1e57f6de2431a305))
91
-
92
- ## [4.4.4](https://github.com/dequelabs/axe-core-npm/compare/v4.4.3...v4.4.4) (2022-08-10)
93
-
94
- **Note:** Version bump only for package @axe-core/cli
95
-
96
- ## [4.4.3](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.3) (2022-06-03)
97
-
98
- **Note:** Version bump only for package @axe-core/cli
99
-
100
- ## [4.4.2](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.2) (2022-03-14)
101
-
102
- **Note:** Version bump only for package @axe-core/cli
103
-
104
- ## [4.4.1](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.1) (2022-02-15)
105
-
106
- ### Bug Fixes
107
-
108
- - **cli:** update packages to use `latest` version of ChromeDriver ([#454](https://github.com/dequelabs/axe-core-npm/issues/454)) ([607fa1b](https://github.com/dequelabs/axe-core-npm/commit/607fa1b3f9d7f0d8181a2ef19df03d53e65f7237))
109
-
110
- # [4.4.0](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.0) (2022-02-10)
111
-
112
- ### Bug Fixes
113
-
114
- - **cli:** add `endTimer()` for page load timer ([#236](https://github.com/dequelabs/axe-core-npm/issues/236)) ([e0a19a3](https://github.com/dequelabs/axe-core-npm/commit/e0a19a3bad9b9965df9b98f391efb3403ab737ae))
115
- - **cli:** add timeout waiting for page to be ready ([#250](https://github.com/dequelabs/axe-core-npm/issues/250)) ([cbb795f](https://github.com/dequelabs/axe-core-npm/commit/cbb795f1a92c419794a5f1f9645e28493d7c9bdb))
116
- - **cli:** find axe-core when installed globally ([#232](https://github.com/dequelabs/axe-core-npm/issues/232)) ([75c273d](https://github.com/dequelabs/axe-core-npm/commit/75c273d6b8b4dcec1f953605a5bf4c9b818436cb))
117
- - **cli:** pass chromedriver-path arg to webdriver ([#416](https://github.com/dequelabs/axe-core-npm/issues/416)) ([14e5125](https://github.com/dequelabs/axe-core-npm/commit/14e512551506a333b0249049c3c08c605b2026c3))
118
- - **cli:** provide a more robust error message if analysis fails ([#421](https://github.com/dequelabs/axe-core-npm/issues/421)) ([9f1fa5d](https://github.com/dequelabs/axe-core-npm/commit/9f1fa5d8cb7c2c87bd6e92fe7b13b961e3d73f37))
119
- - pass chrome options to `chromeOptions.addArguments()` ([#262](https://github.com/dequelabs/axe-core-npm/issues/262)) ([715f463](https://github.com/dequelabs/axe-core-npm/commit/715f463c1324d11cafec4a357ee55f446584cd1c))
120
- - selenium-webdriverjs peer dependency to allow newer versions ([#258](https://github.com/dequelabs/axe-core-npm/issues/258)) ([2dc2788](https://github.com/dequelabs/axe-core-npm/commit/2dc27883aa4aa40e64766b0bc60191cb1a4f8963))
121
- - update axe-core to 4.2.1 ([#254](https://github.com/dequelabs/axe-core-npm/issues/254)) ([9d90185](https://github.com/dequelabs/axe-core-npm/commit/9d9018525a4d799f6d763d0329f05ccbfd20dbe4))
122
- - **webdriverjs:** prevent selnium undefined -> null transformation ([#402](https://github.com/dequelabs/axe-core-npm/issues/402)) ([5095f43](https://github.com/dequelabs/axe-core-npm/commit/5095f43d371a3ad5c8b5a6b3f94e0ad686e85d7b))
123
- - **webdriverjs:** prevent selnium undefined -> null transformation ([#402](https://github.com/dequelabs/axe-core-npm/issues/402)) ([be3912d](https://github.com/dequelabs/axe-core-npm/commit/be3912d47f6a9d5507aec6af2a01484de554daec))
124
- - **webdriverjs:** Reject with actual `Error`s (not strings) ([#423](https://github.com/dequelabs/axe-core-npm/issues/423)) ([3fdb50a](https://github.com/dequelabs/axe-core-npm/commit/3fdb50ad7b9106fa288d7c2b3092ec31de5d984b)), closes [#422](https://github.com/dequelabs/axe-core-npm/issues/422) [#421](https://github.com/dequelabs/axe-core-npm/issues/421) [#387](https://github.com/dequelabs/axe-core-npm/issues/387) [#308](https://github.com/dequelabs/axe-core-npm/issues/308) [#207](https://github.com/dequelabs/axe-core-npm/issues/207)
125
-
126
- ### Features
127
-
128
- - **react:** Add configuration option to optional disable cache (deduplication) ([#309](https://github.com/dequelabs/axe-core-npm/issues/309)) ([435811c](https://github.com/dequelabs/axe-core-npm/commit/435811cb3957cf84b1c1701f6de5c4eb740c8301))
129
- - update `axe-core@4.2.2` ([#263](https://github.com/dequelabs/axe-core-npm/issues/263)) ([8c609e1](https://github.com/dequelabs/axe-core-npm/commit/8c609e1e3580a63f8697ca94e146b0e2ed28e579))
130
- - update axe-core to 4.2.0 ([#240](https://github.com/dequelabs/axe-core-npm/issues/240)) ([4e8f7fe](https://github.com/dequelabs/axe-core-npm/commit/4e8f7fee9db09fb56f91ea34f9984be66a29033e))
131
- - update to use `axe-core@4.2.3` ([#280](https://github.com/dequelabs/axe-core-npm/issues/280)) ([8aebba5](https://github.com/dequelabs/axe-core-npm/commit/8aebba5c6069ca047f649446e072259c069c9a22))
132
- - upgrade axe-core to 4.4.1 ([#441](https://github.com/dequelabs/axe-core-npm/issues/441)) ([765c81a](https://github.com/dequelabs/axe-core-npm/commit/765c81a2ae63e8c72ec086b86174a5c5f343ea9b))
133
- - **webdriverjs:** upgrade to axe-core 4.3 ([#312](https://github.com/dequelabs/axe-core-npm/issues/312)) ([b416e74](https://github.com/dequelabs/axe-core-npm/commit/b416e74fb56526021b010996c0e1382269627efa))
134
-
135
- ## [4.3.1](https://github.com/dequelabs/axe-core-npm/compare/v4.3.0...v4.3.1) (2021-09-20)
136
-
137
- ### Bug Fixes
138
-
139
- - **cli,reporter-earl,react:** use correct version of axe-core ([#378](https://github.com/dequelabs/axe-core-npm/issues/378)) ([0c7d050](https://github.com/dequelabs/axe-core-npm/commit/0c7d0506b7d397df3c96414fc37a408e90fe9a9c))
140
-
141
- # [4.3.0](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.3.0) (2021-09-20)
142
-
143
- ### Bug Fixes
144
-
145
- - pass chrome options to `chromeOptions.addArguments()` ([#262](https://github.com/dequelabs/axe-core-npm/issues/262)) ([715f463](https://github.com/dequelabs/axe-core-npm/commit/715f463c1324d11cafec4a357ee55f446584cd1c))
146
- - selenium-webdriverjs peer dependency to allow newer versions ([#258](https://github.com/dequelabs/axe-core-npm/issues/258)) ([2dc2788](https://github.com/dequelabs/axe-core-npm/commit/2dc27883aa4aa40e64766b0bc60191cb1a4f8963))
147
- - update axe-core to 4.2.1 ([#254](https://github.com/dequelabs/axe-core-npm/issues/254)) ([9d90185](https://github.com/dequelabs/axe-core-npm/commit/9d9018525a4d799f6d763d0329f05ccbfd20dbe4))
148
- - **cli:** add timeout waiting for page to be ready ([#250](https://github.com/dequelabs/axe-core-npm/issues/250)) ([cbb795f](https://github.com/dequelabs/axe-core-npm/commit/cbb795f1a92c419794a5f1f9645e28493d7c9bdb))
149
-
150
- ### Features
151
-
152
- - **react:** Add configuration option to optional disable cache (deduplication) ([#309](https://github.com/dequelabs/axe-core-npm/issues/309)) ([435811c](https://github.com/dequelabs/axe-core-npm/commit/435811cb3957cf84b1c1701f6de5c4eb740c8301))
153
- - **webdriverjs:** upgrade to axe-core 4.3 ([#312](https://github.com/dequelabs/axe-core-npm/issues/312)) ([b416e74](https://github.com/dequelabs/axe-core-npm/commit/b416e74fb56526021b010996c0e1382269627efa))
154
- - update `axe-core@4.2.2` ([#263](https://github.com/dequelabs/axe-core-npm/issues/263)) ([8c609e1](https://github.com/dequelabs/axe-core-npm/commit/8c609e1e3580a63f8697ca94e146b0e2ed28e579))
155
- - update to use `axe-core@4.2.3` ([#280](https://github.com/dequelabs/axe-core-npm/issues/280)) ([8aebba5](https://github.com/dequelabs/axe-core-npm/commit/8aebba5c6069ca047f649446e072259c069c9a22))
156
-
157
- ## [4.2.2](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.2.2) (2021-06-23)
158
-
159
- ### Bug Fixes
160
-
161
- - pass chrome options to `chromeOptions.addArguments()` ([#262](https://github.com/dequelabs/axe-core-npm/issues/262)) ([715f463](https://github.com/dequelabs/axe-core-npm/commit/715f463c1324d11cafec4a357ee55f446584cd1c))
162
- - selenium-webdriverjs peer dependency to allow newer versions ([#258](https://github.com/dequelabs/axe-core-npm/issues/258)) ([2dc2788](https://github.com/dequelabs/axe-core-npm/commit/2dc27883aa4aa40e64766b0bc60191cb1a4f8963))
163
- - update axe-core to 4.2.1 ([#254](https://github.com/dequelabs/axe-core-npm/issues/254)) ([9d90185](https://github.com/dequelabs/axe-core-npm/commit/9d9018525a4d799f6d763d0329f05ccbfd20dbe4))
164
- - **cli:** add timeout waiting for page to be ready ([#250](https://github.com/dequelabs/axe-core-npm/issues/250)) ([cbb795f](https://github.com/dequelabs/axe-core-npm/commit/cbb795f1a92c419794a5f1f9645e28493d7c9bdb))
165
-
166
- ### Features
167
-
168
- - update `axe-core@4.2.2` ([#263](https://github.com/dequelabs/axe-core-npm/issues/263)) ([8c609e1](https://github.com/dequelabs/axe-core-npm/commit/8c609e1e3580a63f8697ca94e146b0e2ed28e579))
169
- - update to use `axe-core@4.2.3` ([#280](https://github.com/dequelabs/axe-core-npm/issues/280)) ([8aebba5](https://github.com/dequelabs/axe-core-npm/commit/8aebba5c6069ca047f649446e072259c069c9a22))
170
-
171
- ## [4.2.1](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.2.1) (2021-05-19)
172
-
173
- ### Bug Fixes
174
-
175
- - update axe-core to 4.2.1 ([#254](https://github.com/dequelabs/axe-core-npm/issues/254)) ([9d90185](https://github.com/dequelabs/axe-core-npm/commit/9d9018525a4d799f6d763d0329f05ccbfd20dbe4))
176
- - **cli:** add timeout waiting for page to be ready ([#250](https://github.com/dequelabs/axe-core-npm/issues/250)) ([cbb795f](https://github.com/dequelabs/axe-core-npm/commit/cbb795f1a92c419794a5f1f9645e28493d7c9bdb))
177
-
178
- # [4.2.0](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.2.0) (2021-05-05)
179
-
180
- ### Bug Fixes
181
-
182
- - **cli:** add `endTimer()` for page load timer ([#236](https://github.com/dequelabs/axe-core-npm/issues/236)) ([e0a19a3](https://github.com/dequelabs/axe-core-npm/commit/e0a19a3bad9b9965df9b98f391efb3403ab737ae))
183
- - **cli:** find axe-core when installed globally ([#232](https://github.com/dequelabs/axe-core-npm/issues/232)) ([75c273d](https://github.com/dequelabs/axe-core-npm/commit/75c273d6b8b4dcec1f953605a5bf4c9b818436cb))
184
-
185
- ### Features
186
-
187
- - update axe-core to 4.2.0 ([#240](https://github.com/dequelabs/axe-core-npm/issues/240)) ([4e8f7fe](https://github.com/dequelabs/axe-core-npm/commit/4e8f7fee9db09fb56f91ea34f9984be66a29033e))
188
-
189
- ## [4.1.1](https://github.com/dequelabs/axe-core-npm/compare/v4.0.0...v4.1.1) (2021-01-28)
190
-
191
- ### Bug Fixes
192
-
193
- - **cli:** create a directory when one does not exist ([#187](https://github.com/dequelabs/axe-core-npm/issues/187)) ([814cabf](https://github.com/dequelabs/axe-core-npm/commit/814cabf1082a758940b0a7917a1993fdd1d013af))
194
- - **react:** Prevent config TypeError ([708c463](https://github.com/dequelabs/axe-core-npm/commit/708c46366d5f2069a4f25238beb32299abc962b9))
195
-
196
- # [4.1.0](https://github.com/dequelabs/axe-core-npm/compare/v4.0.0...v4.1.0) (2020-11-20)
197
-
198
- **Note:** Version bump only for package @axe-core/cli
199
-
200
- # 4.0.0 (2020-08-25)
201
-
202
- ### Bug Fixes
203
-
204
- - **cli:** add timeout to `webdriver.js` ([#47](https://github.com/dequelabs/axe-core-npm/issues/47)) ([b9a3a3d](https://github.com/dequelabs/axe-core-npm/commit/b9a3a3d2bd1fc5c8a749dfa78d1b52f77756bca1))
205
- - **cli:** change default mocha timeout for testing ([#18](https://github.com/dequelabs/axe-core-npm/issues/18)) ([f1e770c](https://github.com/dequelabs/axe-core-npm/commit/f1e770c22e2f170eec5757d58cc140818fb6a76b))
206
- - **cli:** Enable program to work with `pkg` ([#48](https://github.com/dequelabs/axe-core-npm/issues/48)) ([a9ccea6](https://github.com/dequelabs/axe-core-npm/commit/a9ccea6cf7f152daa016f5ccc9fa85222ab9bdc0))
207
- - **cli:** fix main in `package.json` so that we can use functions in `axe-test-urls` file ([#26](https://github.com/dequelabs/axe-core-npm/issues/26)) ([651af8f](https://github.com/dequelabs/axe-core-npm/commit/651af8faa2d4e44e49bcb311fc4b4e4d03f70d84))
208
- - **cli:** fix webdriver being passed from index.js ([#33](https://github.com/dequelabs/axe-core-npm/issues/33)) ([7c939d6](https://github.com/dequelabs/axe-core-npm/commit/7c939d667c02d594ef810fefdc9663b6c856cfbc))
209
- - **cli:** start webdriver correctly ([#69](https://github.com/dequelabs/axe-core-npm/issues/69)) ([90675b4](https://github.com/dequelabs/axe-core-npm/commit/90675b47a0d9301dd5578785888e56785c6a442f))
210
- - **webdriverjs:** Require `new` when instantiating ([#31](https://github.com/dequelabs/axe-core-npm/issues/31)) ([c0aa15c](https://github.com/dequelabs/axe-core-npm/commit/c0aa15ca0134f300fa5db4887d73c4e9633af2ca))
211
- - Make packages public ([#23](https://github.com/dequelabs/axe-core-npm/issues/23)) ([56395f0](https://github.com/dequelabs/axe-core-npm/commit/56395f047985f8f81951531de84b79ff8bb33881))
212
-
213
- ### Features
214
-
215
- - update `@axe-core/*` to use axe-core v4.0.1 ([#56](https://github.com/dequelabs/axe-core-npm/issues/56)) ([4b0ea09](https://github.com/dequelabs/axe-core-npm/commit/4b0ea095fe0963640e1e11f53665a66ad775f4df))
216
- - **cli:** replace axe-webdriverjs in favor of @axe-core/webdriverjs ([#51](https://github.com/dequelabs/axe-core-npm/issues/51)) ([734a795](https://github.com/dequelabs/axe-core-npm/commit/734a795c2b7b6478ba9c3586d4489a04244a7011))
217
- - Add `@axe-core/cli` ([#6](https://github.com/dequelabs/axe-core-npm/issues/6)) ([2db54c2](https://github.com/dequelabs/axe-core-npm/commit/2db54c2476a3d5c2a1b3c85da58f90ac077e61e5))
218
-
219
- ### BREAKING CHANGES
220
-
221
- - **webdriverjs:** use `new AxeBuilder()`, not `AxeBuilder()`
@@ -1,420 +0,0 @@
1
- import 'mocha';
2
- import { assert } from 'chai';
3
- import tempy from 'tempy';
4
- import http from 'http';
5
- import net from 'net';
6
- import path from 'path';
7
- import fs from 'fs';
8
- import { version } from '../../package.json';
9
- import runCLI from '../testutils/';
10
-
11
- const SIMPLE_HTML_FILE = path.join(__dirname, '..', 'testutils', 'simple.html');
12
- const SIMPLE_CLEAN_HTML_FILE = path.join(
13
- __dirname,
14
- '..',
15
- 'testutils',
16
- 'simple-clean.html'
17
- );
18
- const SIMPLE_HTML_SOURCE = fs.readFileSync(SIMPLE_HTML_FILE, 'utf8');
19
- const PATH_TO_AXE_250 = path.resolve(
20
- __dirname,
21
- '..',
22
- 'testutils',
23
- 'axe-core@2.5.0.js'
24
- );
25
-
26
- describe('cli', () => {
27
- it('--help', async () => {
28
- const result = await runCLI('--help');
29
- assert.equal(result.exitCode, 0);
30
- assert.include(result.stdout, 'Options:');
31
- });
32
-
33
- it('--version', async () => {
34
- const result = await runCLI('--version');
35
- assert.equal(result.exitCode, 0);
36
- assert.deepEqual(result.stdout, version);
37
- });
38
-
39
- describe('given a file:// url', () => {
40
- it('should run an analysis', async () => {
41
- const result = await runCLI(`file://${SIMPLE_HTML_FILE}`);
42
- assert.equal(result.exitCode, 0);
43
- assert.include(
44
- result.stdout,
45
- 'Violation of "marquee" with 1 occurrences!'
46
- );
47
- });
48
- });
49
-
50
- describe('given a http:// url', () => {
51
- let port: number;
52
- let server: http.Server;
53
- before(done => {
54
- server = http.createServer((req, res) => {
55
- res.setHeader('Content-Type', 'text/html');
56
- res.write(SIMPLE_HTML_SOURCE);
57
- res.end();
58
- });
59
- server.listen(0, () => {
60
- port = (server.address() as net.AddressInfo).port;
61
- done();
62
- });
63
- });
64
-
65
- after(done => server.close(done));
66
-
67
- it('should run an analysis', async () => {
68
- const result = await runCLI(`http://127.0.0.1:${port}/`);
69
- assert.equal(result.exitCode, 0);
70
- assert.include(
71
- result.stdout,
72
- 'Violation of "marquee" with 1 occurrences!'
73
- );
74
- });
75
- });
76
-
77
- describe('--axe-source', () => {
78
- it('should use the provided version of axe-core', async () => {
79
- const result = await runCLI(
80
- `file://${SIMPLE_HTML_FILE}`,
81
- '--axe-source',
82
- PATH_TO_AXE_250
83
- );
84
-
85
- assert.equal(result.exitCode, 0);
86
- assert.include(
87
- result.stdout,
88
- 'Violation of "marquee" with 1 occurrences!'
89
- );
90
- assert.include(result.stdout, 'Running axe-core 2.5.0');
91
- });
92
-
93
- it('error when given invalid axe source path', async () => {
94
- const result = await runCLI(
95
- `file://${SIMPLE_HTML_FILE}`,
96
- '--axe-source',
97
- 'foobar'
98
- );
99
-
100
- assert.equal(result.exitCode, 2);
101
- assert.include(result.stderr, 'Unable to find the axe-core source file');
102
- });
103
- });
104
-
105
- // cannot run in ci we _should_ have the ability to add arguments to firefox not just chrome to allow users to run this headless
106
- describe.skip('--browser', () => {
107
- it('should change the browser', async () => {
108
- const result = await runCLI(
109
- `file://${SIMPLE_HTML_FILE}`,
110
- '--browser',
111
- 'firefox',
112
- '--verbose'
113
- );
114
- assert.equal(result.exitCode, 0);
115
- assert.include(result.stdout, 'Firefox');
116
- });
117
- });
118
-
119
- describe('--rules', () => {
120
- it('should only run the rules with the provided IDs', async () => {
121
- const result = await runCLI(
122
- `file://${SIMPLE_HTML_FILE}`,
123
- '--rules',
124
- 'region'
125
- );
126
- assert.equal(result.exitCode, 0);
127
- assert.include(result.stdout, 'Violation of "region" with');
128
- });
129
- });
130
-
131
- describe('--tags', () => {
132
- it('should only run rules with the provided tags', async () => {
133
- const result = await runCLI(
134
- `file://${SIMPLE_HTML_FILE}`,
135
- '--tags',
136
- 'cat.parsing,wcag222'
137
- );
138
- assert.equal(result.exitCode, 0);
139
- // Region is tagged with "cat.keyboard", "best-practice"
140
- assert.notInclude(result.stdout, 'Violation of "region" with');
141
- });
142
- });
143
-
144
- describe('--exit', () => {
145
- it('should exit non-zero if violations are found', async () => {
146
- try {
147
- await runCLI(`file://${SIMPLE_HTML_FILE}`, '--exit');
148
- } catch (error) {
149
- assert.equal(error.exitCode, 1);
150
- assert.include(
151
- error.stdout,
152
- 'Violation of "marquee" with 1 occurrences!'
153
- );
154
- }
155
- });
156
-
157
- it('should exit zero if violations are found', async () => {
158
- try {
159
- await runCLI(`file://${SIMPLE_CLEAN_HTML_FILE}`, '--exit');
160
- } catch (error) {
161
- assert.equal(error.exitCode, 0);
162
- assert.include(
163
- error.stdout,
164
- 'Violation of "marquee" with 1 occurrences!'
165
- );
166
- }
167
- });
168
- });
169
-
170
- describe('--dir', () => {
171
- let reportDir: string;
172
- beforeEach(() => {
173
- reportDir = tempy.directory();
174
- });
175
-
176
- it('should save a JSON report to the provided directory', async () => {
177
- const result = await runCLI(
178
- `file://${SIMPLE_HTML_FILE}`,
179
- '--dir',
180
- reportDir
181
- );
182
-
183
- assert.equal(result.exitCode, 0);
184
- const files = fs.readdirSync(reportDir);
185
- const report = files.find(f => f.endsWith('.json'));
186
- assert(report, 'Did not create JSON report');
187
- });
188
- });
189
-
190
- describe('--include', () => {
191
- it('should set a list of elements to include', async () => {
192
- const result = await runCLI(
193
- `file://${SIMPLE_HTML_FILE}`,
194
- '--include',
195
- 'marquee'
196
- );
197
- assert.notInclude(result.stdout, 'Violation of "region"');
198
- assert.include(
199
- result.stdout,
200
- 'Violation of "marquee" with 1 occurrences!'
201
- );
202
- });
203
-
204
- it('should throw error if CSS selector is not found', async () => {
205
- const result = await runCLI(
206
- `file://${SIMPLE_HTML_FILE}`,
207
- '--include',
208
- '#hazaar',
209
- '--show-errors'
210
- );
211
-
212
- assert.include(
213
- result.stderr,
214
- 'javascript error: No elements found for include in page Context'
215
- );
216
- assert.equal(result.exitCode, 1);
217
- });
218
-
219
- it('should throw error if invalid selector is provided', async () => {
220
- const result = await runCLI(
221
- `file://${SIMPLE_HTML_FILE}`,
222
- '--include',
223
- '#123',
224
- '--show-errors'
225
- );
226
-
227
- assert.include(result.stderr, 'is not a valid selector');
228
- assert.equal(result.exitCode, 1);
229
- });
230
- });
231
-
232
- describe('--exclude', () => {
233
- it('should set a list of elements to exclude', async () => {
234
- const result = await runCLI(
235
- `file://${SIMPLE_HTML_FILE}`,
236
- '--exclude',
237
- 'marquee'
238
- );
239
- assert.notInclude(
240
- result.stdout,
241
- 'Violation of "marquee" with 1 occurrences!'
242
- );
243
- });
244
-
245
- it('should throw error if invalid selector is provided', async () => {
246
- const result = await runCLI(
247
- `file://${SIMPLE_HTML_FILE}`,
248
- '--exclude',
249
- '#123',
250
- '--show-errors'
251
- );
252
-
253
- assert.include(result.stderr, 'is not a valid selector');
254
- assert.equal(result.exitCode, 1);
255
- });
256
- });
257
-
258
- describe('--disable', () => {
259
- it('should not run rules with the provided IDs', async () => {
260
- const result = await runCLI(
261
- `file://${SIMPLE_HTML_FILE}`,
262
- '--disable',
263
- 'region'
264
- );
265
- assert.notInclude(result.stdout, 'Violation of "region" with');
266
- });
267
- });
268
-
269
- describe('--stdout', () => {
270
- it('should only emit JSON to stdout', async () => {
271
- const result = await runCLI(`file://${SIMPLE_HTML_FILE}`, '--stdout');
272
- assert.equal(result.exitCode, 0);
273
- assert.doesNotThrow(
274
- () => JSON.parse(result.stdout),
275
- 'Emitted invalid JSON'
276
- );
277
- });
278
- });
279
-
280
- describe('--timer', () => {
281
- it('should log the time it takes to run', async () => {
282
- const result = await runCLI(`file://${SIMPLE_HTML_FILE}`, '--timer');
283
- assert.equal(result.exitCode, 0);
284
- assert.isEmpty(result.stderr);
285
- assert.include(result.stdout, 'axe-core execution time');
286
- assert.include(result.stdout, 'Total test time');
287
- });
288
- });
289
-
290
- describe('--no-reporter', () => {
291
- it('should log the time it takes to run', async () => {
292
- const result = await runCLI(
293
- `file://${SIMPLE_HTML_FILE}`,
294
- '--no-reporter'
295
- );
296
- assert.equal(result.exitCode, 0);
297
- assert.notInclude(
298
- result.stdout,
299
- 'Violation of "marquee" with 1 occurrences!'
300
- );
301
- });
302
- });
303
-
304
- describe('--show-errors', () => {
305
- it('should log the time it takes to run defaults to show errors', async () => {
306
- const result = await runCLI(
307
- `file://${SIMPLE_HTML_FILE}`,
308
- '--include',
309
- '#hazaar'
310
- );
311
- assert.equal(result.exitCode, 1);
312
- assert.include(
313
- result.stderr,
314
- 'Error: JavascriptError: javascript error:'
315
- );
316
- });
317
-
318
- it('do not show errors when passed false', async () => {
319
- const result = await runCLI(
320
- `file://${SIMPLE_HTML_FILE}`,
321
- '--include',
322
- '#hazaar',
323
- '--show-errors',
324
- 'false'
325
- );
326
- assert.equal(result.exitCode, 1);
327
- assert.include(
328
- result.stderr,
329
- 'An error occurred while testing this page.'
330
- );
331
- });
332
- });
333
-
334
- describe('--save', () => {
335
- let reportDir: string;
336
- beforeEach(() => {
337
- reportDir = tempy.directory();
338
- });
339
-
340
- it('should save the output as a JSON file', async () => {
341
- const result = await runCLI(
342
- `file://${SIMPLE_HTML_FILE}`,
343
- '--save',
344
- 'test-name.json',
345
- '--dir',
346
- reportDir
347
- );
348
- const [report] = fs.readdirSync(reportDir);
349
- assert.equal(result.exitCode, 0);
350
- assert.equal(report, 'test-name.json');
351
- });
352
- });
353
-
354
- describe('--load-delay', () => {
355
- it('should set how much time axe will wait after a page loads before running the audit', async () => {
356
- const result = await runCLI(
357
- `file://${SIMPLE_HTML_FILE}`,
358
- '--load-delay',
359
- '1000'
360
- );
361
- assert.equal(result.exitCode, 0);
362
- assert.include(
363
- result.stdout,
364
- 'Waiting for 1000 milliseconds after page load'
365
- );
366
- });
367
- });
368
-
369
- describe('--verbose', () => {
370
- it('should output metadata such as test tool name, version and environment', async () => {
371
- const result = await runCLI(`file://${SIMPLE_HTML_FILE}`, '--verbose');
372
- assert.equal(result.exitCode, 0);
373
- assert.include(result.stdout, 'Test Runner');
374
- assert.include(result.stdout, 'Test Engine');
375
- assert.include(result.stdout, 'Test Environment');
376
- });
377
- });
378
-
379
- describe('--timeout', () => {
380
- // Timeout the page immediately. Ideally we'd block the page for awhile, then timeout based on that. This seemed easier for now tho.
381
- it('should set the page load timeout', async () => {
382
- try {
383
- await runCLI(`file://${SIMPLE_HTML_FILE}`, '--timeout', '0');
384
- } catch (error) {
385
- assert.notEqual(error.exitCode, 0);
386
- assert.include(
387
- error.stderr,
388
- 'An error occurred while testing this page.'
389
- );
390
- }
391
- });
392
- });
393
-
394
- // disabled during conversion to npm workspaces as the node_module install directory changed
395
- // @see https://github.com/dequelabs/axe-core-npm/issues/822
396
- describe.skip('--chromedriver-path', () => {
397
- it('should throw error if path does not exist', async () => {
398
- const result = await runCLI(
399
- `file://${SIMPLE_HTML_FILE}`,
400
- '--chromedriver-path="someinvalidpath"',
401
- '--show-errors'
402
- );
403
- assert.include(
404
- result.stderr,
405
- 'The specified executable path does not exist'
406
- );
407
- });
408
- });
409
-
410
- describe('--chrome-path', () => {
411
- it('should throw error if path does not exist', async () => {
412
- const result = await runCLI(
413
- `file://${SIMPLE_HTML_FILE}`,
414
- '--chrome-path="someinvalidpath"',
415
- '--show-errors'
416
- );
417
- assert.include(result.stderr, 'no chrome binary at');
418
- });
419
- });
420
- });