@axe-core/cli 4.7.4-alpha.409 → 4.7.4-cbd2a5f.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.
package/CHANGELOG.md DELETED
@@ -1,201 +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.7.3](https://github.com/dequelabs/axe-core-npm/compare/v4.7.2...v4.7.3) (2023-06-09)
7
-
8
- **Note:** Version bump only for package @axe-core/cli
9
-
10
- ## [4.7.2](https://github.com/dequelabs/axe-core-npm/compare/v4.7.1...v4.7.2) (2023-06-01)
11
-
12
- ### Bug Fixes
13
-
14
- - **packages/cli:** revert ESM ([#730](https://github.com/dequelabs/axe-core-npm/issues/730)) ([4e1fb95](https://github.com/dequelabs/axe-core-npm/commit/4e1fb958fa251db7eea3433f91f2a2f3adbda1e8))
15
-
16
- ## [4.7.1](https://github.com/dequelabs/axe-core-npm/compare/v4.7.0...v4.7.1) (2023-05-02)
17
-
18
- **Note:** Version bump only for package @axe-core/cli
19
-
20
- # [4.7.0](https://github.com/dequelabs/axe-core-npm/compare/v4.6.1...v4.7.0) (2023-04-28)
21
-
22
- ### Bug Fixes
23
-
24
- - **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))
25
-
26
- ### Features
27
-
28
- - enable esm import ([#713](https://github.com/dequelabs/axe-core-npm/issues/713)) ([076bfa9](https://github.com/dequelabs/axe-core-npm/commit/076bfa99f27f416b4eaff6d24cc23e8573fc72ee))
29
- - 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))
30
-
31
- ## [4.6.1](https://github.com/dequelabs/axe-core-npm/compare/v4.6.0...v4.6.1) (2023-03-28)
32
-
33
- ### Bug Fixes
34
-
35
- - **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))
36
- - 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))
37
-
38
- # [4.6.0](https://github.com/dequelabs/axe-core-npm/compare/v4.5.2...v4.6.0) (2023-01-19)
39
-
40
- ### Features
41
-
42
- - support shadow dom selectors ([#619](https://github.com/dequelabs/axe-core-npm/issues/619)) ([6065b56](https://github.com/dequelabs/axe-core-npm/commit/6065b562adf289341033a7233426ba3dcfb8a24b))
43
- - 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))
44
-
45
- ## [4.5.2](https://github.com/dequelabs/axe-core-npm/compare/v4.5.1...v4.5.2) (2022-11-15)
46
-
47
- ### Bug Fixes
48
-
49
- - **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))
50
- - **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))
51
- - 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))
52
-
53
- ## [4.5.1](https://github.com/dequelabs/axe-core-npm/compare/v4.5.0...v4.5.1) (2022-11-03)
54
-
55
- ### Bug Fixes
56
-
57
- - 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))
58
-
59
- # [4.5.0](https://github.com/dequelabs/axe-core-npm/compare/v4.4.5...v4.5.0) (2022-10-26)
60
-
61
- ### Features
62
-
63
- - 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))
64
-
65
- ## [4.4.5](https://github.com/dequelabs/axe-core-npm/compare/v4.4.4...v4.4.5) (2022-09-26)
66
-
67
- ### Bug Fixes
68
-
69
- - **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))
70
- - 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))
71
-
72
- ## [4.4.4](https://github.com/dequelabs/axe-core-npm/compare/v4.4.3...v4.4.4) (2022-08-10)
73
-
74
- **Note:** Version bump only for package @axe-core/cli
75
-
76
- ## [4.4.3](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.3) (2022-06-03)
77
-
78
- **Note:** Version bump only for package @axe-core/cli
79
-
80
- ## [4.4.2](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.2) (2022-03-14)
81
-
82
- **Note:** Version bump only for package @axe-core/cli
83
-
84
- ## [4.4.1](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.1) (2022-02-15)
85
-
86
- ### Bug Fixes
87
-
88
- - **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))
89
-
90
- # [4.4.0](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.4.0) (2022-02-10)
91
-
92
- ### Bug Fixes
93
-
94
- - **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))
95
- - **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))
96
- - **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))
97
- - **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))
98
- - **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))
99
- - 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))
100
- - 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))
101
- - 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))
102
- - **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))
103
- - **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))
104
- - **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)
105
-
106
- ### Features
107
-
108
- - **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))
109
- - 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))
110
- - 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))
111
- - 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))
112
- - 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))
113
- - **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))
114
-
115
- ## [4.3.1](https://github.com/dequelabs/axe-core-npm/compare/v4.3.0...v4.3.1) (2021-09-20)
116
-
117
- ### Bug Fixes
118
-
119
- - **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))
120
-
121
- # [4.3.0](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.3.0) (2021-09-20)
122
-
123
- ### Bug Fixes
124
-
125
- - 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))
126
- - 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))
127
- - 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))
128
- - **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))
129
-
130
- ### Features
131
-
132
- - **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))
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
- - 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))
135
- - 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))
136
-
137
- ## [4.2.2](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.2.2) (2021-06-23)
138
-
139
- ### Bug Fixes
140
-
141
- - 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))
142
- - 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))
143
- - 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))
144
- - **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))
145
-
146
- ### Features
147
-
148
- - 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))
149
- - 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))
150
-
151
- ## [4.2.1](https://github.com/dequelabs/axe-core-npm/compare/v4.2.0...v4.2.1) (2021-05-19)
152
-
153
- ### Bug Fixes
154
-
155
- - 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))
156
- - **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))
157
-
158
- # [4.2.0](https://github.com/dequelabs/axe-core-npm/compare/v4.1.1...v4.2.0) (2021-05-05)
159
-
160
- ### Bug Fixes
161
-
162
- - **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))
163
- - **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))
164
-
165
- ### Features
166
-
167
- - 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))
168
-
169
- ## [4.1.1](https://github.com/dequelabs/axe-core-npm/compare/v4.0.0...v4.1.1) (2021-01-28)
170
-
171
- ### Bug Fixes
172
-
173
- - **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))
174
- - **react:** Prevent config TypeError ([708c463](https://github.com/dequelabs/axe-core-npm/commit/708c46366d5f2069a4f25238beb32299abc962b9))
175
-
176
- # [4.1.0](https://github.com/dequelabs/axe-core-npm/compare/v4.0.0...v4.1.0) (2020-11-20)
177
-
178
- **Note:** Version bump only for package @axe-core/cli
179
-
180
- # 4.0.0 (2020-08-25)
181
-
182
- ### Bug Fixes
183
-
184
- - **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))
185
- - **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))
186
- - **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))
187
- - **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))
188
- - **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))
189
- - **cli:** start webdriver correctly ([#69](https://github.com/dequelabs/axe-core-npm/issues/69)) ([90675b4](https://github.com/dequelabs/axe-core-npm/commit/90675b47a0d9301dd5578785888e56785c6a442f))
190
- - **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))
191
- - Make packages public ([#23](https://github.com/dequelabs/axe-core-npm/issues/23)) ([56395f0](https://github.com/dequelabs/axe-core-npm/commit/56395f047985f8f81951531de84b79ff8bb33881))
192
-
193
- ### Features
194
-
195
- - 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))
196
- - **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))
197
- - Add `@axe-core/cli` ([#6](https://github.com/dequelabs/axe-core-npm/issues/6)) ([2db54c2](https://github.com/dequelabs/axe-core-npm/commit/2db54c2476a3d5c2a1b3c85da58f90ac077e61e5))
198
-
199
- ### BREAKING CHANGES
200
-
201
- - **webdriverjs:** use `new AxeBuilder()`, not `AxeBuilder()`
@@ -1,407 +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
- describe('--chromedriver-path', () => {
395
- it('should throw error if path does not exist', async () => {
396
- const result = await runCLI(
397
- `file://${SIMPLE_HTML_FILE}`,
398
- '--chromedriver-path="someinvalidpath"',
399
- '--show-errors'
400
- );
401
- assert.include(
402
- result.stderr,
403
- 'The specified executable path does not exist'
404
- );
405
- });
406
- });
407
- });