@elliemae/pui-cli 8.17.0-alpha.4 → 8.17.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.
@@ -94,7 +94,7 @@ const jestConfig = {
94
94
  url: `http://localhost:3111${basePath}`,
95
95
  resources: 'usable',
96
96
  },
97
- testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
97
+ testEnvironment: 'jsdom',
98
98
  watchPlugins: [
99
99
  'jest-watch-typeahead/filename',
100
100
  'jest-watch-typeahead/testname',
@@ -23,8 +23,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
  var import_runtime = require("regenerator-runtime/runtime");
25
25
  var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
26
+ var import_jest_axe = __toESM(require("jest-axe"), 1);
26
27
  var import_resize_observer_polyfill = __toESM(require("resize-observer-polyfill"), 1);
27
- var import_axe_core = require("./extended/axe-core");
28
28
  var import_matchMedia = require("./mocks/matchMedia.js");
29
29
  var import_pui_diagnostics = require("./mocks/pui-diagnostics.js");
30
30
  const originalError = console.error;
@@ -47,7 +47,7 @@ console.error = (...args) => {
47
47
  return originalError(...args);
48
48
  };
49
49
  if (expect)
50
- expect.extend(import_axe_core.toHaveNoViolations);
50
+ expect.extend(import_jest_axe.default.toHaveNoViolations);
51
51
  const addElementToBody = (element) => {
52
52
  const documentEle = (window || {}).document;
53
53
  if (!documentEle)
@@ -94,7 +94,7 @@ const jestConfig = {
94
94
  url: `http://localhost:3111${basePath}`,
95
95
  resources: 'usable',
96
96
  },
97
- testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
97
+ testEnvironment: 'jsdom',
98
98
  watchPlugins: [
99
99
  'jest-watch-typeahead/filename',
100
100
  'jest-watch-typeahead/testname',
@@ -1,7 +1,7 @@
1
1
  import "regenerator-runtime/runtime";
2
2
  import "@testing-library/jest-dom/extend-expect";
3
+ import jestAxe from "jest-axe";
3
4
  import ResizeObserver from "resize-observer-polyfill";
4
- import { toHaveNoViolations } from "./extended/axe-core";
5
5
  import { addMatchMedia } from "./mocks/matchMedia.js";
6
6
  import { logger } from "./mocks/pui-diagnostics.js";
7
7
  const originalError = console.error;
@@ -24,7 +24,7 @@ console.error = (...args) => {
24
24
  return originalError(...args);
25
25
  };
26
26
  if (expect)
27
- expect.extend(toHaveNoViolations);
27
+ expect.extend(jestAxe.toHaveNoViolations);
28
28
  const addElementToBody = (element) => {
29
29
  const documentEle = (window || {}).document;
30
30
  if (!documentEle)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "8.17.0-alpha.4",
3
+ "version": "8.17.0",
4
4
  "description": "ICE MT UI Platform CLI",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -76,30 +76,30 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@axe-core/react": "~4.7.3",
79
- "@babel/cli": "~7.22.10",
80
- "@babel/core": "~7.22.10",
81
- "@babel/eslint-parser": "~7.22.10",
82
- "@babel/node": "~7.22.10",
79
+ "@babel/cli": "~7.22.15",
80
+ "@babel/core": "~7.22.17",
81
+ "@babel/eslint-parser": "~7.22.15",
82
+ "@babel/node": "~7.22.15",
83
83
  "@babel/plugin-proposal-class-properties": "~7.18.6",
84
- "@babel/plugin-proposal-export-default-from": "~7.22.5",
84
+ "@babel/plugin-proposal-export-default-from": "~7.22.17",
85
85
  "@babel/plugin-syntax-dynamic-import": "~7.8.3",
86
86
  "@babel/plugin-syntax-import-assertions": "~7.22.5",
87
- "@babel/plugin-transform-modules-commonjs": "~7.22.5",
87
+ "@babel/plugin-transform-modules-commonjs": "~7.22.15",
88
88
  "@babel/plugin-transform-react-constant-elements": "~7.22.5",
89
89
  "@babel/plugin-transform-react-inline-elements": "~7.22.5",
90
90
  "@babel/plugin-transform-react-jsx-source": "~7.22.5",
91
- "@babel/plugin-transform-runtime": "~7.22.10",
92
- "@babel/preset-env": "~7.22.10",
93
- "@babel/preset-react": "~7.22.5",
94
- "@babel/preset-typescript": "~7.22.5",
95
- "@babel/runtime": "~7.22.10",
91
+ "@babel/plugin-transform-runtime": "~7.22.15",
92
+ "@babel/preset-env": "~7.22.15",
93
+ "@babel/preset-react": "~7.22.15",
94
+ "@babel/preset-typescript": "~7.22.15",
95
+ "@babel/runtime": "~7.22.15",
96
96
  "@commitlint/cli": "~17.7.1",
97
97
  "@commitlint/config-conventional": "~17.7.0",
98
98
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.8.0",
99
99
  "@faker-js/faker": "~7.6.0",
100
- "@nrwl/cli": "~15.9.5",
101
- "@nrwl/tao": "~15.9.5",
102
- "@nrwl/workspace": "~15.9.5",
100
+ "@nrwl/cli": "~15.9.6",
101
+ "@nrwl/tao": "~15.9.6",
102
+ "@nrwl/workspace": "~15.9.6",
103
103
  "@pmmmwh/react-refresh-webpack-plugin": "~0.5.11",
104
104
  "@semantic-release/changelog": "~6.0.3",
105
105
  "@semantic-release/exec": "~6.0.3",
@@ -118,35 +118,35 @@
118
118
  "@stylelint/postcss-css-in-js": "~0.38.0",
119
119
  "@svgr/webpack": "~7.0.0",
120
120
  "@swc/cli": "~0.1.62",
121
- "@swc/core": "~1.3.78",
121
+ "@swc/core": "~1.3.84",
122
122
  "@swc/jest": "~0.2.29",
123
123
  "@testing-library/jest-dom": "~5.17.0",
124
124
  "@testing-library/react": "~14.0.0",
125
125
  "@testing-library/react-hooks": "~8.0.1",
126
126
  "@testing-library/user-event": "~14.4.3",
127
- "@types/circular-dependency-plugin": "~5.0.5",
128
- "@types/compression": "~1.7.2",
129
- "@types/cors": "~2.8.13",
127
+ "@types/circular-dependency-plugin": "~5.0.6",
128
+ "@types/compression": "~1.7.3",
129
+ "@types/cors": "~2.8.14",
130
130
  "@types/duplicate-package-checker-webpack-plugin": "~2.1.2",
131
131
  "@types/ip": "~1.1.0",
132
132
  "@types/jest": "~29.5.4",
133
133
  "@types/jest-axe": "~3.5.5",
134
134
  "@types/moment-locales-webpack-plugin": "~1.2.3",
135
- "@types/node": "~18.17.8",
135
+ "@types/node": "~18.17.15",
136
136
  "@types/normalize-path": "~3.0.0",
137
137
  "@types/postcss-preset-env": "~7.7.0",
138
138
  "@types/rimraf": "~3.0.2",
139
139
  "@types/speed-measure-webpack-plugin": "~1.3.4",
140
140
  "@types/supertest": "~2.0.12",
141
141
  "@types/testing-library__jest-dom": "~5.14.9",
142
- "@types/uuid": "~9.0.2",
142
+ "@types/uuid": "~9.0.3",
143
143
  "@types/webpack-bundle-analyzer": "~4.6.0",
144
144
  "@typescript-eslint/eslint-plugin": "~5.62.0",
145
145
  "@typescript-eslint/parser": "~5.62.0",
146
146
  "@vitejs/plugin-react": "~4.0.4",
147
147
  "@vitest/coverage-c8": "~0.33.0",
148
148
  "autoprefixer": "~10.4.15",
149
- "axe-core": "~4.7.2",
149
+ "axe-core": "~4.8.1",
150
150
  "babel-plugin-date-fns": "~2.0.0",
151
151
  "babel-plugin-dynamic-import-node": "~2.3.3",
152
152
  "babel-plugin-import-remove-resource-query": "~1.0.0",
@@ -169,8 +169,8 @@
169
169
  "cross-env": "~7.0.3",
170
170
  "css-loader": "~6.8.1",
171
171
  "css-minimizer-webpack-plugin": "~5.0.1",
172
- "depcheck": "~1.4.5",
173
- "docdash": "~2.0.1",
172
+ "depcheck": "~1.4.6",
173
+ "docdash": "~2.0.2",
174
174
  "dotenv": "~16.3.1",
175
175
  "dotenv-webpack": "~8.0.1",
176
176
  "duplicate-package-checker-webpack-plugin": "~3.0.0",
@@ -178,7 +178,7 @@
178
178
  "esbuild": "~0.19.2",
179
179
  "esbuild-loader": "~3.2.0",
180
180
  "esbuild-plugin-svgr": "~1.1.0",
181
- "eslint": "~8.47.0",
181
+ "eslint": "~8.49.0",
182
182
  "eslint-config-airbnb": "~19.0.4",
183
183
  "eslint-config-airbnb-base": "~15.0.0",
184
184
  "eslint-config-airbnb-typescript": "~17.1.0",
@@ -187,7 +187,7 @@
187
187
  "eslint-import-resolver-babel-module": "~5.3.2",
188
188
  "eslint-import-resolver-typescript": "~3.6.0",
189
189
  "eslint-import-resolver-webpack": "~0.13.7",
190
- "eslint-plugin-compat": "~4.1.4",
190
+ "eslint-plugin-compat": "~4.2.0",
191
191
  "eslint-plugin-eslint-comments": "~3.2.0",
192
192
  "eslint-plugin-import": "~2.28.1",
193
193
  "eslint-plugin-jest": "~27.2.3",
@@ -219,8 +219,8 @@
219
219
  "imports-loader": "~4.0.1",
220
220
  "ip": "~1.1.8",
221
221
  "jest-axe": "~7.0.1",
222
- "jest-cli": "~29.6.3",
223
- "jest-environment-jsdom": "~29.6.3",
222
+ "jest-cli": "~29.7.0",
223
+ "jest-environment-jsdom": "~29.7.0",
224
224
  "jest-sonar-reporter": "~2.0.0",
225
225
  "jest-styled-components": "~7.1.1",
226
226
  "jest-watch-typeahead": "~2.2.2",
@@ -232,23 +232,23 @@
232
232
  "minimist": "~1.2.8",
233
233
  "moment": "~2.29.4",
234
234
  "moment-locales-webpack-plugin": "~1.2.0",
235
- "msw": "~1.2.3",
235
+ "msw": "~1.3.0",
236
236
  "node-gyp": "~9.4.0",
237
- "node-plop": "~0.31.1",
237
+ "node-plop": "~0.32.0",
238
238
  "nodemon": "~2.0.22",
239
239
  "normalize-path": "~3.0.0",
240
- "npm-check-updates": "16.13.0",
240
+ "npm-check-updates": "16.14.0",
241
241
  "npm-run-all": "~4.1.5",
242
- "pino": "~8.15.0",
243
- "pino-http": "~8.4.0",
242
+ "pino": "~8.15.1",
243
+ "pino-http": "~8.5.0",
244
244
  "pino-pretty": "~10.2.0",
245
245
  "plop": "~3.1.2",
246
- "postcss": "~8.4.28",
246
+ "postcss": "~8.4.29",
247
247
  "postcss-html": "~1.5.0",
248
248
  "postcss-jsx": "~0.36.4",
249
249
  "postcss-loader": "~7.3.3",
250
250
  "postcss-markdown": "~1.2.0",
251
- "postcss-preset-env": "9.1.0",
251
+ "postcss-preset-env": "9.1.3",
252
252
  "postcss-syntax": "~0.36.2",
253
253
  "prettier": "~2.8.8",
254
254
  "prisma": "~4.16.2",
@@ -261,7 +261,7 @@
261
261
  "resize-observer-polyfill": "~1.5.1",
262
262
  "resolve-typescript-plugin": "~2.0.1",
263
263
  "rimraf": "~5.0.1",
264
- "semantic-release": "~21.0.9",
264
+ "semantic-release": "~21.1.1",
265
265
  "slackify-markdown": "~4.4.0",
266
266
  "speed-measure-webpack-plugin": "~1.5.0",
267
267
  "storybook-addon-turbo-build": "~1.1.0",
@@ -274,22 +274,22 @@
274
274
  "swc-loader": "~0.2.3",
275
275
  "ts-node": "~10.9.1",
276
276
  "tsc-alias": "~1.8.7",
277
- "tsx": "~3.12.7",
278
- "typedoc": "~0.24.8",
279
- "typescript": "~5.1.6",
277
+ "tsx": "~3.12.10",
278
+ "typedoc": "~0.25.1",
279
+ "typescript": "~5.2.2",
280
280
  "update-notifier": "~6.0.2",
281
281
  "url-loader": "~4.1.1",
282
- "uuid": "~9.0.0",
282
+ "uuid": "~9.0.1",
283
283
  "vite": "~4.4.9",
284
- "vite-tsconfig-paths": "~4.2.0",
285
- "vitest": "~0.34.2",
284
+ "vite-tsconfig-paths": "~4.2.1",
285
+ "vitest": "~0.34.4",
286
286
  "webpack": "~5.88.2",
287
- "webpack-bundle-analyzer": "~4.9.0",
287
+ "webpack-bundle-analyzer": "~4.9.1",
288
288
  "webpack-cli": "~5.1.4",
289
289
  "webpack-dev-server": "~4.15.1",
290
290
  "webpack-manifest-plugin": "~5.0.0",
291
291
  "webpack-merge": "~5.9.0",
292
- "whatwg-fetch": "~3.6.17",
292
+ "whatwg-fetch": "~3.6.19",
293
293
  "workbox-webpack-plugin": "~6.6.0",
294
294
  "yargs": "~17.7.2"
295
295
  },
@@ -1,37 +0,0 @@
1
- const { TestEnvironment } = require('jest-environment-jsdom');
2
-
3
- // ICE platform is meant to be run on node > 18
4
- // "jest-environment-jsdom": "~29.6.3" is instead meant to support node >16
5
- // features that are supported since node 17 & 18 are not supported in jsdom env
6
- // the limitation is not relevant for us since we are already running on node 18 anyway,
7
- // this "ExtendedJSDomEnv" is an extension of the
8
- // jest.config.cjs
9
- // {
10
- // ...
11
- // testEnvironment: 'jsdom'
12
- // ...
13
- // }
14
- // that actually uses node 18 features that are not supported in "jest-environment-jsdom": "~29.6.3"
15
-
16
- // https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
17
- class FixJSDOMEnvironment extends TestEnvironment {
18
- constructor(...args) {
19
- super(...args);
20
-
21
- // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
22
-
23
- // FIXME https://github.com/jsdom/jsdom/issues/3363
24
- if (structuredClone) this.global.structuredClone = structuredClone;
25
-
26
- // FIXME https://github.com/jsdom/jsdom/issues/1724
27
- if (fetch) this.global.fetch = fetch;
28
- if (Headers) this.global.Headers = Headers;
29
- if (Request) this.global.Request = Request;
30
- if (Response) this.global.Response = Response;
31
-
32
- // FIXME https://github.com/jsdom/jsdom/issues/1721
33
- if (URL) this.global.URL = URL;
34
- if (Blob) this.global.Blob = Blob;
35
- }
36
- }
37
- module.exports = FixJSDOMEnvironment;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var getMessageAndPass_exports = {};
20
- __export(getMessageAndPass_exports, {
21
- getMessageAndPass: () => getMessageAndPass
22
- });
23
- module.exports = __toCommonJS(getMessageAndPass_exports);
24
- var import_jest_matcher_utils = require("jest-matcher-utils");
25
- var import_reporter = require("./reporter.js");
26
- const getMessageAndPass = (violations) => {
27
- const formatedViolations = (0, import_reporter.reporter)(violations);
28
- const pass = formatedViolations.length === 0;
29
- if (pass)
30
- return { message: () => "", pass };
31
- return {
32
- message: () => `${(0, import_jest_matcher_utils.matcherHint)(".toHaveNoViolations")}
33
-
34
- ${formatedViolations}`,
35
- pass
36
- };
37
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var axe_core_exports = {};
20
- __export(axe_core_exports, {
21
- toHaveNoViolations: () => import_toHaveNoViolations.toHaveNoViolations
22
- });
23
- module.exports = __toCommonJS(axe_core_exports);
24
- var import_toHaveNoViolations = require("./toHaveNoViolations.js");
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var reporter_exports = {};
20
- __export(reporter_exports, {
21
- reporter: () => reporter
22
- });
23
- module.exports = __toCommonJS(reporter_exports);
24
- var import_jest_matcher_utils = require("jest-matcher-utils");
25
- const colorYellow = (arg) => `\x1B[93m ${arg || ""} \x1B[0m`;
26
- const colorGrey = (arg) => `\x1B[90m ${arg || ""} \x1B[0m`;
27
- const colorBlue = (arg) => `\x1B[34m ${arg || ""} \x1B[0m`;
28
- const reporter = (violToFormat) => {
29
- if (violToFormat.length === 0)
30
- return "";
31
- const lineBreak = "\n\n";
32
- const horizontalLine = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
33
- return violToFormat.map((violation) => {
34
- const errorBody = violation.nodes.map((node) => {
35
- const selector = node.target.join(", ");
36
- const expectedText = `Expected the HTML found at $('${selector}') to have no violations:${lineBreak}`;
37
- let violationHelpUrl = "";
38
- if (violation.helpUrl)
39
- violationHelpUrl = `You can find more information on this issue here:
40
- ${colorBlue(
41
- violation.helpUrl
42
- )}`;
43
- return `${expectedText + colorGrey(node.html) + lineBreak}Received:${lineBreak}${(0, import_jest_matcher_utils.printReceived)(
44
- `${violation.help} (${violation.id})`
45
- )}${lineBreak}${colorYellow(
46
- node.failureSummary
47
- )}${lineBreak}${violationHelpUrl}`;
48
- }).join(lineBreak);
49
- return errorBody;
50
- }).join(lineBreak + horizontalLine + lineBreak);
51
- };
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var shouldIgnoreNodeViolation_exports = {};
20
- __export(shouldIgnoreNodeViolation_exports, {
21
- shouldIgnoreNodeViolation: () => shouldIgnoreNodeViolation
22
- });
23
- module.exports = __toCommonJS(shouldIgnoreNodeViolation_exports);
24
- const dataAttributeRegexp = /(data-[\S]*)=["']([\S]*)["']/gm;
25
- const shouldIgnoreNodeViolation = (node, violation) => [...node.html.matchAll(dataAttributeRegexp)].map(([fullMatch, dataKey, dataValue]) => ({
26
- fullMatch,
27
- dataKey,
28
- dataValue
29
- })).some(
30
- ({ dataKey, dataValue }) => dataKey === `data-axe-ignore-${violation.id}` && dataValue === "true"
31
- );
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var toHaveNoViolations_exports = {};
20
- __export(toHaveNoViolations_exports, {
21
- toHaveNoViolations: () => toHaveNoViolations
22
- });
23
- module.exports = __toCommonJS(toHaveNoViolations_exports);
24
- var import_getMessageAndPass = require("./getMessageAndPass.js");
25
- var import_shouldIgnoreNodeViolation = require("./shouldIgnoreNodeViolation.js");
26
- const toHaveNoViolations = {
27
- toHaveNoViolations(results) {
28
- const { violations } = results;
29
- const finalViolations = [];
30
- violations.forEach((violation) => {
31
- const { nodes } = violation;
32
- const newNodes = [];
33
- nodes.forEach((node) => {
34
- if (!(0, import_shouldIgnoreNodeViolation.shouldIgnoreNodeViolation)(node, violation))
35
- newNodes.push(node);
36
- });
37
- if (newNodes.length > 0) {
38
- finalViolations.push({ ...violation, nodes: newNodes });
39
- }
40
- });
41
- return { actual: violations, ...(0, import_getMessageAndPass.getMessageAndPass)(finalViolations) };
42
- }
43
- };
@@ -1,37 +0,0 @@
1
- const { TestEnvironment } = require('jest-environment-jsdom');
2
-
3
- // ICE platform is meant to be run on node > 18
4
- // "jest-environment-jsdom": "~29.6.3" is instead meant to support node >16
5
- // features that are supported since node 17 & 18 are not supported in jsdom env
6
- // the limitation is not relevant for us since we are already running on node 18 anyway,
7
- // this "ExtendedJSDomEnv" is an extension of the
8
- // jest.config.cjs
9
- // {
10
- // ...
11
- // testEnvironment: 'jsdom'
12
- // ...
13
- // }
14
- // that actually uses node 18 features that are not supported in "jest-environment-jsdom": "~29.6.3"
15
-
16
- // https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
17
- class FixJSDOMEnvironment extends TestEnvironment {
18
- constructor(...args) {
19
- super(...args);
20
-
21
- // From here on we are using "node" (currently running version of it) to polyfill jsdom this.global
22
-
23
- // FIXME https://github.com/jsdom/jsdom/issues/3363
24
- if (structuredClone) this.global.structuredClone = structuredClone;
25
-
26
- // FIXME https://github.com/jsdom/jsdom/issues/1724
27
- if (fetch) this.global.fetch = fetch;
28
- if (Headers) this.global.Headers = Headers;
29
- if (Request) this.global.Request = Request;
30
- if (Response) this.global.Response = Response;
31
-
32
- // FIXME https://github.com/jsdom/jsdom/issues/1721
33
- if (URL) this.global.URL = URL;
34
- if (Blob) this.global.Blob = Blob;
35
- }
36
- }
37
- module.exports = FixJSDOMEnvironment;
@@ -1,17 +0,0 @@
1
- import { matcherHint } from "jest-matcher-utils";
2
- import { reporter } from "./reporter.js";
3
- const getMessageAndPass = (violations) => {
4
- const formatedViolations = reporter(violations);
5
- const pass = formatedViolations.length === 0;
6
- if (pass)
7
- return { message: () => "", pass };
8
- return {
9
- message: () => `${matcherHint(".toHaveNoViolations")}
10
-
11
- ${formatedViolations}`,
12
- pass
13
- };
14
- };
15
- export {
16
- getMessageAndPass
17
- };
@@ -1,4 +0,0 @@
1
- import { toHaveNoViolations } from "./toHaveNoViolations.js";
2
- export {
3
- toHaveNoViolations
4
- };
@@ -1,31 +0,0 @@
1
- import { printReceived } from "jest-matcher-utils";
2
- const colorYellow = (arg) => `\x1B[93m ${arg || ""} \x1B[0m`;
3
- const colorGrey = (arg) => `\x1B[90m ${arg || ""} \x1B[0m`;
4
- const colorBlue = (arg) => `\x1B[34m ${arg || ""} \x1B[0m`;
5
- const reporter = (violToFormat) => {
6
- if (violToFormat.length === 0)
7
- return "";
8
- const lineBreak = "\n\n";
9
- const horizontalLine = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
10
- return violToFormat.map((violation) => {
11
- const errorBody = violation.nodes.map((node) => {
12
- const selector = node.target.join(", ");
13
- const expectedText = `Expected the HTML found at $('${selector}') to have no violations:${lineBreak}`;
14
- let violationHelpUrl = "";
15
- if (violation.helpUrl)
16
- violationHelpUrl = `You can find more information on this issue here:
17
- ${colorBlue(
18
- violation.helpUrl
19
- )}`;
20
- return `${expectedText + colorGrey(node.html) + lineBreak}Received:${lineBreak}${printReceived(
21
- `${violation.help} (${violation.id})`
22
- )}${lineBreak}${colorYellow(
23
- node.failureSummary
24
- )}${lineBreak}${violationHelpUrl}`;
25
- }).join(lineBreak);
26
- return errorBody;
27
- }).join(lineBreak + horizontalLine + lineBreak);
28
- };
29
- export {
30
- reporter
31
- };
@@ -1,11 +0,0 @@
1
- const dataAttributeRegexp = /(data-[\S]*)=["']([\S]*)["']/gm;
2
- const shouldIgnoreNodeViolation = (node, violation) => [...node.html.matchAll(dataAttributeRegexp)].map(([fullMatch, dataKey, dataValue]) => ({
3
- fullMatch,
4
- dataKey,
5
- dataValue
6
- })).some(
7
- ({ dataKey, dataValue }) => dataKey === `data-axe-ignore-${violation.id}` && dataValue === "true"
8
- );
9
- export {
10
- shouldIgnoreNodeViolation
11
- };
@@ -1,23 +0,0 @@
1
- import { getMessageAndPass } from "./getMessageAndPass.js";
2
- import { shouldIgnoreNodeViolation } from "./shouldIgnoreNodeViolation.js";
3
- const toHaveNoViolations = {
4
- toHaveNoViolations(results) {
5
- const { violations } = results;
6
- const finalViolations = [];
7
- violations.forEach((violation) => {
8
- const { nodes } = violation;
9
- const newNodes = [];
10
- nodes.forEach((node) => {
11
- if (!shouldIgnoreNodeViolation(node, violation))
12
- newNodes.push(node);
13
- });
14
- if (newNodes.length > 0) {
15
- finalViolations.push({ ...violation, nodes: newNodes });
16
- }
17
- });
18
- return { actual: violations, ...getMessageAndPass(finalViolations) };
19
- }
20
- };
21
- export {
22
- toHaveNoViolations
23
- };
@@ -1,5 +0,0 @@
1
- export = FixJSDOMEnvironment;
2
- declare const FixJSDOMEnvironment_base: typeof import("jest-environment-jsdom").default;
3
- declare class FixJSDOMEnvironment extends FixJSDOMEnvironment_base {
4
- constructor(...args: any[]);
5
- }
@@ -1,8 +0,0 @@
1
- import type { Result } from 'axe-core';
2
- export declare const getMessageAndPass: (violations: Result[]) => {
3
- message: () => string;
4
- pass: true;
5
- } | {
6
- message: () => string;
7
- pass: false;
8
- };
@@ -1 +0,0 @@
1
- export { toHaveNoViolations } from './toHaveNoViolations.js';
@@ -1,2 +0,0 @@
1
- import type { Result } from 'axe-core';
2
- export declare const reporter: (violToFormat: Result[]) => string;
@@ -1,2 +0,0 @@
1
- import type { NodeResult, Result } from 'axe-core';
2
- export declare const shouldIgnoreNodeViolation: (node: NodeResult, violation: Result) => boolean;
@@ -1,12 +0,0 @@
1
- import type { AxeResults, Result } from 'axe-core';
2
- export declare const toHaveNoViolations: {
3
- toHaveNoViolations(results: AxeResults): {
4
- message: () => string;
5
- pass: true;
6
- actual: Result[];
7
- } | {
8
- message: () => string;
9
- pass: false;
10
- actual: Result[];
11
- };
12
- };
File without changes