aria-ease 6.4.8 → 6.5.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/README.md +15 -27
- package/bin/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
- package/bin/cli.cjs +952 -513
- package/bin/cli.js +1 -1
- package/bin/contractTestRunnerPlaywright-7F756CFB.js +984 -0
- package/bin/{test-WICJJ62P.js → test-C3CMRHSI.js} +39 -32
- package/dist/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +35 -19
- package/dist/contractTestRunnerPlaywright-7F756CFB.js +984 -0
- package/dist/index.cjs +958 -519
- package/dist/index.js +46 -39
- package/dist/src/{Types.d-DYfYR3Vc.d.cts → Types.d-yGC2bBaB.d.cts} +1 -1
- package/dist/src/{Types.d-DYfYR3Vc.d.ts → Types.d-yGC2bBaB.d.ts} +1 -1
- package/dist/src/accordion/index.d.cts +1 -1
- package/dist/src/accordion/index.d.ts +1 -1
- package/dist/src/block/index.d.cts +1 -1
- package/dist/src/block/index.d.ts +1 -1
- package/dist/src/checkbox/index.d.cts +1 -1
- package/dist/src/checkbox/index.d.ts +1 -1
- package/dist/src/combobox/index.d.cts +1 -1
- package/dist/src/combobox/index.d.ts +1 -1
- package/dist/src/menu/index.cjs +7 -7
- package/dist/src/menu/index.d.cts +1 -1
- package/dist/src/menu/index.d.ts +1 -1
- package/dist/src/menu/index.js +7 -7
- package/dist/src/radio/index.d.cts +1 -1
- package/dist/src/radio/index.d.ts +1 -1
- package/dist/src/tabs/index.d.cts +1 -1
- package/dist/src/tabs/index.d.ts +1 -1
- package/dist/src/toggle/index.d.cts +1 -1
- package/dist/src/toggle/index.d.ts +1 -1
- package/dist/src/utils/test/{contracts/AccordionContract.json → aria-contracts/accordion/accordion.contract.json} +20 -7
- package/dist/src/utils/test/{contracts/ComboboxContract.json → aria-contracts/combobox/combobox.listbox.contract.json} +18 -17
- package/dist/src/utils/test/{contracts/MenuContract.json → aria-contracts/menu/menu.contract.json} +42 -1
- package/dist/src/utils/test/{contracts/TabsContract.json → aria-contracts/tabs/tabs.contract.json} +20 -7
- package/dist/src/utils/test/{chunk-TQBS54MM.js → chunk-AUJAN4RK.js} +34 -18
- package/dist/src/utils/test/contractTestRunnerPlaywright-HL73FADJ.js +955 -0
- package/dist/src/utils/test/index.cjs +921 -505
- package/dist/src/utils/test/index.d.cts +6 -1
- package/dist/src/utils/test/index.d.ts +6 -1
- package/dist/src/utils/test/index.js +38 -31
- package/package.json +2 -2
- package/bin/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
- package/dist/contractTestRunnerPlaywright-D57V4RSU.js +0 -628
- package/dist/src/utils/test/contractTestRunnerPlaywright-HV4EIRDH.js +0 -610
|
@@ -3,6 +3,11 @@ interface JestAxeResult {
|
|
|
3
3
|
raw: unknown;
|
|
4
4
|
contract: unknown;
|
|
5
5
|
}
|
|
6
|
+
interface ContractTestResult {
|
|
7
|
+
passes: string[];
|
|
8
|
+
failures: string[];
|
|
9
|
+
skipped: string[];
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* Runs static and interactions accessibility test on UI components.
|
|
@@ -12,7 +17,7 @@ interface JestAxeResult {
|
|
|
12
17
|
*/
|
|
13
18
|
|
|
14
19
|
declare function testUiComponent(componentName: string, component: HTMLElement | null, url: string | null): Promise<JestAxeResult>;
|
|
15
|
-
declare let runTest: () => Promise<
|
|
20
|
+
declare let runTest: () => Promise<ContractTestResult>;
|
|
16
21
|
/**
|
|
17
22
|
* Cleanup function to close the shared Playwright browser
|
|
18
23
|
* Call this in afterAll() or after all tests complete
|
|
@@ -3,6 +3,11 @@ interface JestAxeResult {
|
|
|
3
3
|
raw: unknown;
|
|
4
4
|
contract: unknown;
|
|
5
5
|
}
|
|
6
|
+
interface ContractTestResult {
|
|
7
|
+
passes: string[];
|
|
8
|
+
failures: string[];
|
|
9
|
+
skipped: string[];
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* Runs static and interactions accessibility test on UI components.
|
|
@@ -12,7 +17,7 @@ interface JestAxeResult {
|
|
|
12
17
|
*/
|
|
13
18
|
|
|
14
19
|
declare function testUiComponent(componentName: string, component: HTMLElement | null, url: string | null): Promise<JestAxeResult>;
|
|
15
|
-
declare let runTest: () => Promise<
|
|
20
|
+
declare let runTest: () => Promise<ContractTestResult>;
|
|
16
21
|
/**
|
|
17
22
|
* Cleanup function to close the shared Playwright browser
|
|
18
23
|
* Call this in afterAll() or after all tests complete
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { closeSharedBrowser, ContractReporter, contract_default } from './chunk-
|
|
1
|
+
import { closeSharedBrowser, ContractReporter, contract_default } from './chunk-AUJAN4RK.js';
|
|
2
2
|
import { axe } from 'jest-axe';
|
|
3
3
|
import fs from 'fs/promises';
|
|
4
4
|
|
|
@@ -17,6 +17,7 @@ async function runContractTests(componentName, component) {
|
|
|
17
17
|
const failures = [];
|
|
18
18
|
const passes = [];
|
|
19
19
|
const skipped = [];
|
|
20
|
+
const failuresBeforeStatic = failures.length;
|
|
20
21
|
for (const test of componentContract.static[0].assertions) {
|
|
21
22
|
if (test.target !== "relative") {
|
|
22
23
|
const selector = componentContract.selectors[test.target];
|
|
@@ -55,8 +56,9 @@ async function runContractTests(componentName, component) {
|
|
|
55
56
|
skipped.push(dynamicTest.description);
|
|
56
57
|
reporter.reportTest(dynamicTest, "skip");
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
-
const staticFailed =
|
|
59
|
+
const staticTotal = componentContract.static[0].assertions.length;
|
|
60
|
+
const staticFailed = failures.length - failuresBeforeStatic;
|
|
61
|
+
const staticPassed = Math.max(0, staticTotal - staticFailed);
|
|
60
62
|
reporter.reportStatic(staticPassed, staticFailed);
|
|
61
63
|
reporter.summary(failures);
|
|
62
64
|
return { passes, failures, skipped };
|
|
@@ -106,7 +108,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
|
|
|
106
108
|
const devServerUrl = await checkDevServer(url);
|
|
107
109
|
if (devServerUrl) {
|
|
108
110
|
console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
|
|
109
|
-
const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-
|
|
111
|
+
const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-HL73FADJ.js');
|
|
110
112
|
contract = await runContractTestsPlaywright(componentName, devServerUrl);
|
|
111
113
|
} else {
|
|
112
114
|
throw new Error(
|
|
@@ -161,6 +163,11 @@ ${violationDetails}
|
|
|
161
163
|
return result;
|
|
162
164
|
}
|
|
163
165
|
var runTest = async () => {
|
|
166
|
+
return {
|
|
167
|
+
passes: [],
|
|
168
|
+
failures: [],
|
|
169
|
+
skipped: []
|
|
170
|
+
};
|
|
164
171
|
};
|
|
165
172
|
if (typeof window === "undefined") {
|
|
166
173
|
runTest = async () => {
|
|
@@ -168,36 +175,36 @@ if (typeof window === "undefined") {
|
|
|
168
175
|
`);
|
|
169
176
|
const { exec } = await import('child_process');
|
|
170
177
|
const chalk = (await import('chalk')).default;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (stdout) {
|
|
178
|
+
return new Promise((resolve, reject) => {
|
|
179
|
+
exec(
|
|
180
|
+
`npx vitest --run --reporter verbose`,
|
|
181
|
+
async (error, stdout, stderr) => {
|
|
176
182
|
console.log(stdout);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
183
|
+
if (stderr) console.error(stderr);
|
|
184
|
+
const testsPassed = !error || error.code === 0;
|
|
185
|
+
if (testsPassed) {
|
|
186
|
+
try {
|
|
187
|
+
const { displayBadgeInfo, promptAddBadge } = await import('./badgeHelper-HZKGOPB4.js');
|
|
188
|
+
displayBadgeInfo("component");
|
|
189
|
+
await promptAddBadge("component", process.cwd());
|
|
190
|
+
console.log(chalk.dim("\n" + "\u2500".repeat(60)));
|
|
191
|
+
console.log(chalk.cyan("\u{1F499} Found aria-ease helpful?"));
|
|
192
|
+
console.log(chalk.white(" \u2022 Star us on GitHub: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease"));
|
|
193
|
+
console.log(chalk.white(" \u2022 Share feedback: ") + chalk.blue.underline("https://github.com/aria-ease/aria-ease/discussions"));
|
|
194
|
+
console.log(chalk.dim("\u2500".repeat(60) + "\n"));
|
|
195
|
+
} catch (badgeError) {
|
|
196
|
+
console.error("Warning: Could not display badge prompt:", badgeError);
|
|
197
|
+
}
|
|
198
|
+
resolve({ passes: [], failures: [], skipped: [] });
|
|
199
|
+
process.exit(0);
|
|
200
|
+
} else {
|
|
201
|
+
const exitCode = error?.code || 1;
|
|
202
|
+
reject(new Error(`Tests failed with code ${exitCode}`));
|
|
203
|
+
process.exit(exitCode);
|
|
193
204
|
}
|
|
194
|
-
process.exit(0);
|
|
195
|
-
} else {
|
|
196
|
-
const exitCode = error?.code || 1;
|
|
197
|
-
process.exit(exitCode);
|
|
198
205
|
}
|
|
199
|
-
|
|
200
|
-
);
|
|
206
|
+
);
|
|
207
|
+
});
|
|
201
208
|
};
|
|
202
209
|
}
|
|
203
210
|
async function cleanupTests() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aria-ease",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"description": "Accessibility infrastructure for the entire frontend engineering lifecycle. Build accessible patterns, run automated audits, verify component interactions, and gate deployments — all in one system.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build:modules": "tsup ./src/combobox/index.ts ./src/accordion/index.ts ./src/block/index.ts ./src/checkbox/index.ts ./src/menu/index.ts ./src/tabs/index.ts ./src/radio/index.ts ./src/toggle/index.ts --format esm,cjs --dts --treeshake --outDir dist/src",
|
|
22
22
|
"build:test": "tsup ./src/utils/test/index.ts --format esm,cjs --dts --treeshake --external jest-axe --external @testing-library/react --external playwright --external @playwright/test --outDir dist/src/utils/test",
|
|
23
23
|
"build:cli": "tsup ./src/utils/cli/cli.ts --format esm,cjs --dts --outDir bin --external commander --external chalk --external jest-axe --external @testing-library/react --external @axe-core/playwright --external playwright",
|
|
24
|
-
"build:contracts": "mkdir -p ./dist/src/utils/test && cp -r ./src/utils/test/contract/contracts ./dist/src/utils/test/",
|
|
24
|
+
"build:contracts": "mkdir -p ./dist/src/utils/test && cp -r ./src/utils/test/contract/aria-contracts ./dist/src/utils/test/",
|
|
25
25
|
"build": "npm run clean && npm run build:core && npm run build:modules && npm run build:test && npm run build:cli && npm run build:contracts"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|