vi-axe 0.0.5 → 0.0.6
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/dist/extend-expect.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./src-
|
|
1
|
+
import { n as e, r as t, t as n } from "./src-CypcCU5u.js";
|
|
2
2
|
export { n as axe, t as configureAxe, e as toHaveNoViolations };
|
|
@@ -2534,15 +2534,8 @@ var t = Object.create, n = Object.defineProperty, r = Object.getOwnPropertyDescr
|
|
|
2534
2534
|
symbol: !0
|
|
2535
2535
|
};
|
|
2536
2536
|
t.exports = function() {
|
|
2537
|
-
var e = n.Symbol
|
|
2538
|
-
|
|
2539
|
-
t = e("test symbol");
|
|
2540
|
-
try {
|
|
2541
|
-
String(t);
|
|
2542
|
-
} catch {
|
|
2543
|
-
return !1;
|
|
2544
|
-
}
|
|
2545
|
-
return !(!r[a(e.iterator)] || !r[a(e.toPrimitive)] || !r[a(e.toStringTag)]);
|
|
2537
|
+
var e = n.Symbol;
|
|
2538
|
+
return !(typeof e != "function" || (e("test symbol"), !r[a(e.iterator)]) || !r[a(e.toPrimitive)] || !r[a(e.toStringTag)]);
|
|
2546
2539
|
};
|
|
2547
2540
|
}), br = B(function(e, t) {
|
|
2548
2541
|
t.exports = function(e) {
|
|
@@ -13041,8 +13034,8 @@ var t = Object.create, n = Object.defineProperty, r = Object.getOwnPropertyDescr
|
|
|
13041
13034
|
var n = e.substring(1).split("&");
|
|
13042
13035
|
if (!n || !n.length) return t;
|
|
13043
13036
|
for (var r = 0; r < n.length; r++) {
|
|
13044
|
-
var i = L(n[r].split("="), 2), a = i[0], o = i[1]
|
|
13045
|
-
t[decodeURIComponent(a)] = decodeURIComponent(
|
|
13037
|
+
var i = L(n[r].split("="), 2), a = i[0], o = i[1];
|
|
13038
|
+
t[decodeURIComponent(a)] = decodeURIComponent(o === void 0 ? "" : o);
|
|
13046
13039
|
}
|
|
13047
13040
|
return t;
|
|
13048
13041
|
}
|
|
@@ -34514,11 +34507,11 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`);
|
|
|
34514
34507
|
var n = L(t, 2), r = n[0], i = n[1];
|
|
34515
34508
|
return x(Math.atan2(parseFloat(i), parseFloat(r)));
|
|
34516
34509
|
}
|
|
34517
|
-
var a = parseFloat(t[8]), o = Math.
|
|
34518
|
-
return x(Math.acos(parseFloat(t[0]) /
|
|
34510
|
+
var a = parseFloat(t[8]), o = Math.cos(Math.asin(a));
|
|
34511
|
+
return x(Math.acos(parseFloat(t[0]) / o));
|
|
34519
34512
|
}
|
|
34520
34513
|
function x(e) {
|
|
34521
|
-
return Math.round(
|
|
34514
|
+
return Math.round(180 / Math.PI * e);
|
|
34522
34515
|
}
|
|
34523
34516
|
function S(e) {
|
|
34524
34517
|
return e %= 400, e < 0 && (e += 400), Math.round(e / 400 * 360);
|
|
@@ -35337,10 +35330,10 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`);
|
|
|
35337
35330
|
return n && r;
|
|
35338
35331
|
}
|
|
35339
35332
|
function QE(e) {
|
|
35340
|
-
var t = L(e.match(/^([0-9.]+)([a-z]+)$/i) || [], 3), n = t[1], r = n === void 0 ? "" : n, i = t[2]
|
|
35333
|
+
var t = L(e.match(/^([0-9.]+)([a-z]+)$/i) || [], 3), n = t[1], r = n === void 0 ? "" : n, i = t[2];
|
|
35341
35334
|
return {
|
|
35342
35335
|
value: parseFloat(r),
|
|
35343
|
-
unit:
|
|
35336
|
+
unit: (i === void 0 ? "" : i).toLowerCase()
|
|
35344
35337
|
};
|
|
35345
35338
|
}
|
|
35346
35339
|
var $E = {
|
|
@@ -42285,7 +42278,10 @@ See: https://github.com/dequelabs/axe-core/blob/master/doc/context.md`);
|
|
|
42285
42278
|
return !1;
|
|
42286
42279
|
}
|
|
42287
42280
|
t.exports = cn;
|
|
42288
|
-
})), f = /* @__PURE__ */ l(u(), 1), p = /* @__PURE__ */ l(d(), 1), m = f.default.getRules(["cat.color"])
|
|
42281
|
+
})), f = /* @__PURE__ */ l(u(), 1), p = /* @__PURE__ */ l(d(), 1), m = f.default.getRules(["cat.color"]).map(({ ruleId: e }) => ({
|
|
42282
|
+
enabled: !1,
|
|
42283
|
+
id: e
|
|
42284
|
+
}));
|
|
42289
42285
|
function h(e) {
|
|
42290
42286
|
return !!e && typeof e == "object" && typeof e.tagName == "string";
|
|
42291
42287
|
}
|
|
@@ -42303,21 +42299,18 @@ function _(e) {
|
|
|
42303
42299
|
};
|
|
42304
42300
|
return document.body.innerHTML = e, [document.body, n];
|
|
42305
42301
|
}
|
|
42306
|
-
throw typeof e == "string" ?
|
|
42302
|
+
throw TypeError(typeof e == "string" ? `html parameter ("${e}") has no elements` : "html parameter should be an HTML string or an HTML element");
|
|
42307
42303
|
}
|
|
42308
42304
|
function v(e = {}) {
|
|
42309
|
-
let { globalOptions: t = {}, ...n } = e, { rules: r = [], ...i } = t
|
|
42310
|
-
enabled: !1,
|
|
42311
|
-
id: e
|
|
42312
|
-
}));
|
|
42305
|
+
let { globalOptions: t = {}, ...n } = e, { rules: r = [], ...i } = t;
|
|
42313
42306
|
return f.default.configure({
|
|
42314
|
-
rules: [...
|
|
42307
|
+
rules: [...m, ...r],
|
|
42315
42308
|
...i
|
|
42316
42309
|
}), function(e, t = {}) {
|
|
42317
42310
|
let [r, i] = _(e), a = (0, p.default)({}, n, t);
|
|
42318
42311
|
return new Promise((e, t) => {
|
|
42319
42312
|
f.default.run(r, a, (n, r) => {
|
|
42320
|
-
i(), n
|
|
42313
|
+
i(), n ? t(n) : e(r);
|
|
42321
42314
|
});
|
|
42322
42315
|
});
|
|
42323
42316
|
};
|
|
@@ -42333,31 +42326,23 @@ function b(e) {
|
|
|
42333
42326
|
function x(e, t) {
|
|
42334
42327
|
return t && t.length > 0 ? e.filter((e) => e.impact !== void 0 && e.impact !== null && t.includes(e.impact)) : e;
|
|
42335
42328
|
}
|
|
42336
|
-
var S =
|
|
42337
|
-
|
|
42338
|
-
|
|
42339
|
-
|
|
42340
|
-
|
|
42341
|
-
|
|
42342
|
-
|
|
42343
|
-
|
|
42344
|
-
|
|
42345
|
-
|
|
42346
|
-
Received:
|
|
42347
|
-
|
|
42348
|
-
${b(`${t.help} (${t.id})`)}
|
|
42349
|
-
|
|
42350
|
-
${e("yellow", n.failureSummary ?? "")}
|
|
42351
|
-
|
|
42352
|
-
${i}`;
|
|
42353
|
-
}).join("\n\n")).join("\n\n────────\n\n"))(i), o = a.length === 0;
|
|
42329
|
+
var S = "\n\n", C = "────────";
|
|
42330
|
+
function w(t) {
|
|
42331
|
+
return t.map((t) => t.nodes.map((n) => {
|
|
42332
|
+
let r = `Expected the HTML found at $('${n.target.join(", ")}') to have no violations:${S}`, i = t.helpUrl ? `You can find more information on this issue here: \n${e("blue", t.helpUrl)}` : "";
|
|
42333
|
+
return `${r}${e("gray", n.html)}${S}Received:${S}${b(`${t.help} (${t.id})`)}${S}${e("yellow", n.failureSummary ?? "")}${S}${i}`;
|
|
42334
|
+
}).join(S)).join(S + C + S);
|
|
42335
|
+
}
|
|
42336
|
+
var T = { toHaveNoViolations(e) {
|
|
42337
|
+
if (e.violations === void 0) throw TypeError("Unexpected aXe results object. No violations property found.\nDid you change the `reporter` in your aXe configuration?");
|
|
42338
|
+
let t = e.toolOptions?.impactLevels, n = x(e.violations, t), r = n.length === 0;
|
|
42354
42339
|
return {
|
|
42355
|
-
actual:
|
|
42340
|
+
actual: n,
|
|
42356
42341
|
message: () => {
|
|
42357
|
-
if (!
|
|
42342
|
+
if (!r) return `${y(".toHaveNoViolations")}\n\n${w(n)}`;
|
|
42358
42343
|
},
|
|
42359
|
-
pass:
|
|
42344
|
+
pass: r
|
|
42360
42345
|
};
|
|
42361
|
-
} },
|
|
42346
|
+
} }, E = v();
|
|
42362
42347
|
//#endregion
|
|
42363
|
-
export {
|
|
42348
|
+
export { T as n, v as r, E as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vi-axe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Modern Vitest matcher for aXe for testing accessibility using axe-core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@types/react": "19.2.14",
|
|
41
41
|
"@types/react-dom": "19.2.3",
|
|
42
42
|
"@vue/test-utils": "2.4.6",
|
|
43
|
-
"jsdom": "
|
|
43
|
+
"jsdom": "29.0.1",
|
|
44
44
|
"react": "19.2.4",
|
|
45
45
|
"react-dom": "19.2.4",
|
|
46
|
-
"typescript": "
|
|
46
|
+
"typescript": "6.0.2",
|
|
47
47
|
"unplugin-isolated-decl": "0.15.7",
|
|
48
|
-
"vite": "8.0.
|
|
49
|
-
"vitest": "4.1.
|
|
50
|
-
"vue": "3.5.
|
|
48
|
+
"vite": "8.0.3",
|
|
49
|
+
"vitest": "4.1.2",
|
|
50
|
+
"vue": "3.5.31"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">= 20.0.0"
|