@axe-core/watcher 3.16.0-next.acef2936 → 3.16.0-next.b13ee293

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/LICENSES-3RD-PARTY.md +720 -0
  2. package/dist/Controller.d.ts +1 -1
  3. package/dist/Controller.js +42 -34
  4. package/dist/Controller.js.map +1 -1
  5. package/dist/cypress.js +2 -0
  6. package/dist/cypress.js.map +1 -1
  7. package/dist/cypressCommands.js +3 -0
  8. package/dist/cypressCommands.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/playwright.d.ts +1 -1
  12. package/dist/playwright.js +4 -1
  13. package/dist/playwright.js.map +1 -1
  14. package/dist/playwrightTest.d.ts +9 -3
  15. package/dist/playwrightTest.js +10 -5
  16. package/dist/playwrightTest.js.map +1 -1
  17. package/dist/puppeteer.js +2 -0
  18. package/dist/puppeteer.js.map +1 -1
  19. package/dist/utils/checkUserArgs.d.ts +8 -0
  20. package/dist/utils/checkUserArgs.js +10 -0
  21. package/dist/utils/checkUserArgs.js.map +1 -0
  22. package/dist/wdio.js +3 -0
  23. package/dist/wdio.js.map +1 -1
  24. package/dist/webdriver.js +2 -0
  25. package/dist/webdriver.js.map +1 -1
  26. package/extension/axe.js +1 -1
  27. package/extension/axe.js.LICENSE.txt +1 -1
  28. package/extension/background.js +1 -1
  29. package/extension/content.js +1 -1
  30. package/package.json +5 -4
  31. package/dist/testutils.d.ts +0 -13
  32. package/dist/testutils.js +0 -50
  33. package/dist/testutils.js.map +0 -1
  34. package/dist/utils/assertVariablesWereWritten.test.d.ts +0 -1
  35. package/dist/utils/assertVariablesWereWritten.test.js +0 -31
  36. package/dist/utils/assertVariablesWereWritten.test.js.map +0 -1
  37. package/dist/utils/headlessNotSupportedError.test.d.ts +0 -1
  38. package/dist/utils/headlessNotSupportedError.test.js +0 -21
  39. package/dist/utils/headlessNotSupportedError.test.js.map +0 -1
  40. package/dist/utils/initializeSession.test.d.ts +0 -1
  41. package/dist/utils/initializeSession.test.js +0 -177
  42. package/dist/utils/initializeSession.test.js.map +0 -1
  43. package/dist/utils/isValidExcludePattern.test.d.ts +0 -1
  44. package/dist/utils/isValidExcludePattern.test.js +0 -17
  45. package/dist/utils/isValidExcludePattern.test.js.map +0 -1
  46. package/dist/utils/mergeChromeArgs.test.d.ts +0 -1
  47. package/dist/utils/mergeChromeArgs.test.js +0 -257
  48. package/dist/utils/mergeChromeArgs.test.js.map +0 -1
  49. package/dist/utils/proxyHandlers.test.d.ts +0 -1
  50. package/dist/utils/proxyHandlers.test.js +0 -27
  51. package/dist/utils/proxyHandlers.test.js.map +0 -1
  52. package/dist/utils/validateAxeRunContext.test.d.ts +0 -1
  53. package/dist/utils/validateAxeRunContext.test.js +0 -97
  54. package/dist/utils/validateAxeRunContext.test.js.map +0 -1
  55. package/dist/utils/validateAxeRunOptions.test.d.ts +0 -1
  56. package/dist/utils/validateAxeRunOptions.test.js +0 -215
  57. package/dist/utils/validateAxeRunOptions.test.js.map +0 -1
  58. package/dist/utils/writeVariables.test.d.ts +0 -1
  59. package/dist/utils/writeVariables.test.js +0 -200
  60. package/dist/utils/writeVariables.test.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateAxeRunOptions.test.js","sourceRoot":"","sources":["../../src/utils/validateAxeRunOptions.test.ts"],"names":[],"mappings":";;AAAA,iBAAc;AACd,+BAA6B;AAC7B,mEAA+D;AAE/D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YACxB,aAAM,CAAC,YAAY,CAAC,GAAG,EAAE;gBACvB,IAAA,6CAAqB,GAAE,CAAA;YACzB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAC1E,EAAE,CAAC,QAAQ,EAAE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? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- require("mocha");
30
- const chai_1 = require("chai");
31
- const sinon_1 = __importDefault(require("sinon"));
32
- const fs_1 = __importDefault(require("fs"));
33
- const git = __importStar(require("../git"));
34
- const initializeSessionImp = __importStar(require("./initializeSession"));
35
- const writeVariables_1 = __importDefault(require("./writeVariables"));
36
- describe('writeVariables', () => {
37
- beforeEach(() => {
38
- sinon_1.default.stub(initializeSessionImp, 'default').returns('123');
39
- });
40
- afterEach(() => {
41
- sinon_1.default.restore();
42
- });
43
- describe('given `sessionId` variable', () => {
44
- describe('when provided', () => {
45
- it('should write to variables.json', () => {
46
- const gitStub = sinon_1.default.stub(git);
47
- gitStub.getBranchName.returns('main');
48
- gitStub.getDefaultBranchName.returns('main');
49
- gitStub.getRemoteURL.returns('url');
50
- gitStub.isRepository.returns(true);
51
- gitStub.isDirty.returns(false);
52
- gitStub.getTag.returns(null);
53
- gitStub.getCommitInfo.returns({
54
- message: 'message',
55
- author: 'author',
56
- email: 'email',
57
- hash: 'hash'
58
- });
59
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
60
- (0, writeVariables_1.default)({
61
- apiKey: 'abc',
62
- serverURL: 'http://localhost:3000/',
63
- sessionId: '123',
64
- takeScreenshots: true,
65
- experimentalAdvancedRules: true
66
- });
67
- chai_1.assert.isTrue(writeFileSync.calledOnce);
68
- const stored = JSON.parse(writeFileSync.args[0][1]);
69
- chai_1.assert.deepEqual(stored, {
70
- api_key: 'abc',
71
- server_url: 'http://localhost:3000/',
72
- auto_analyze: true,
73
- session_id: '123',
74
- cypress: false,
75
- take_screenshots: true,
76
- experimental_advanced_rules: true,
77
- run_context: null,
78
- run_options: null,
79
- exclude_url_patterns: null,
80
- git_data: {
81
- git_branch: 'main',
82
- git_default_branch: 'main',
83
- git_url: 'url',
84
- git_tag: null,
85
- git_commit_message: 'message',
86
- git_commit_author: 'author',
87
- git_commit_email: 'email',
88
- git_commit_sha: 'hash',
89
- git_is_dirty: false
90
- }
91
- });
92
- });
93
- });
94
- describe('when not provided', () => {
95
- it('creates a session ID and writes it to variables.json', () => {
96
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
97
- (0, writeVariables_1.default)({
98
- apiKey: 'abc'
99
- });
100
- chai_1.assert.isTrue(writeFileSync.calledOnce);
101
- const variables = JSON.parse(writeFileSync.args[0][1]);
102
- chai_1.assert.exists(variables.session_id);
103
- });
104
- });
105
- });
106
- describe(`runContext`, () => {
107
- describe('when provided', () => {
108
- it('should write to variables.json', () => {
109
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
110
- (0, writeVariables_1.default)({
111
- apiKey: 'abc',
112
- runContext: { include: 'foo', exclude: 'bar' }
113
- });
114
- const stored = JSON.parse(writeFileSync.args[0][1]);
115
- const runContext = stored.run_context;
116
- chai_1.assert.isDefined(runContext);
117
- chai_1.assert.deepEqual(runContext, { include: 'foo', exclude: 'bar' });
118
- });
119
- });
120
- describe('when not provided', () => {
121
- it('should not write to variables.json', () => {
122
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
123
- (0, writeVariables_1.default)({
124
- apiKey: 'abc'
125
- });
126
- const stored = JSON.parse(writeFileSync.args[0][1]);
127
- chai_1.assert.isNull(stored.run_context);
128
- });
129
- });
130
- });
131
- describe(`runOptions`, () => {
132
- describe('when provided', () => {
133
- it('should write to variables.json', () => {
134
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
135
- (0, writeVariables_1.default)({
136
- apiKey: 'abc',
137
- runOptions: {
138
- ancestry: true,
139
- rules: { 'color-contrast': { enabled: false } },
140
- runOnly: { type: 'rules', values: ['color-contrast'] }
141
- }
142
- });
143
- const stored = JSON.parse(writeFileSync.args[0][1]);
144
- const runOptions = stored.run_options;
145
- chai_1.assert.isDefined(runOptions);
146
- chai_1.assert.deepEqual(runOptions, {
147
- ancestry: true,
148
- rules: { 'color-contrast': { enabled: false } },
149
- runOnly: { type: 'rules', values: ['color-contrast'] }
150
- });
151
- });
152
- });
153
- describe('when not provided', () => {
154
- it('should not write to variables.json', () => {
155
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
156
- (0, writeVariables_1.default)({
157
- apiKey: 'abc'
158
- });
159
- const stored = JSON.parse(writeFileSync.args[0][1]);
160
- chai_1.assert.isNull(stored.run_options);
161
- });
162
- });
163
- });
164
- describe(`excludeUrlPatterns`, () => {
165
- describe('when provided', () => {
166
- it('should write to variables.json', () => {
167
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
168
- (0, writeVariables_1.default)({
169
- apiKey: 'abc',
170
- excludeUrlPatterns: ['foo', 'bar']
171
- });
172
- const stored = JSON.parse(writeFileSync.args[0][1]);
173
- const excludeUrlPatterns = stored.exclude_url_patterns;
174
- chai_1.assert.isDefined(excludeUrlPatterns);
175
- chai_1.assert.deepEqual(excludeUrlPatterns, ['foo', 'bar']);
176
- });
177
- });
178
- describe('when not provided', () => {
179
- it('should not write to variables.json', () => {
180
- const writeFileSync = sinon_1.default.stub(fs_1.default, 'writeFileSync');
181
- (0, writeVariables_1.default)({
182
- apiKey: 'abc'
183
- });
184
- const stored = JSON.parse(writeFileSync.args[0][1]);
185
- chai_1.assert.isNull(stored.exclude_url_patterns);
186
- });
187
- });
188
- describe('throws when invalid', () => {
189
- it('should throw', () => {
190
- chai_1.assert.throws(() => {
191
- (0, writeVariables_1.default)({
192
- apiKey: 'abc',
193
- excludeUrlPatterns: ['foo', 'bar', 1]
194
- });
195
- });
196
- });
197
- });
198
- });
199
- });
200
- //# sourceMappingURL=writeVariables.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeVariables.test.js","sourceRoot":"","sources":["../../src/utils/writeVariables.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAc;AACd,+BAA6B;AAC7B,kDAAyB;AACzB,4CAAmB;AACnB,4CAA6B;AAC7B,0EAA2D;AAC3D,sEAAiE;AAEjE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,UAAU,CAAC,GAAG,EAAE;QACd,eAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,eAAK,CAAC,OAAO,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;YAC7B,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;gBACxC,MAAM,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBAC/B,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;gBACrC,OAAO,CAAC,oBAAoB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