@kinora/reporter 0.8.0 → 0.9.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 +22 -0
- package/dist/index.mjs +3 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -71,6 +71,28 @@ Each mounted story id is recorded on the test as a `kinora:story` annotation. Al
|
|
|
71
71
|
|
|
72
72
|
More in the [component testing guide](https://docs.kinora.dev/guides/component-testing/).
|
|
73
73
|
|
|
74
|
+
## Accessibility
|
|
75
|
+
|
|
76
|
+
kinora records the axe scans attached to a test: the rules broken, their impact and the elements
|
|
77
|
+
they hit. `scanA11y` runs the scan with `@axe-core/playwright` (add it to your dev dependencies)
|
|
78
|
+
and attaches the result:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { scanA11y } from '@kinora/reporter/a11y'
|
|
82
|
+
import { expect, test } from '@playwright/test'
|
|
83
|
+
|
|
84
|
+
test('checkout is accessible', async ({ page }) => {
|
|
85
|
+
await page.goto('/checkout')
|
|
86
|
+
const { violations } = await scanA11y(page)
|
|
87
|
+
expect(violations).toEqual([]) // leave it out to record the violations as warnings
|
|
88
|
+
})
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A scan you build yourself works too, as long as it is attached to the test with
|
|
92
|
+
`testInfo.attach(name, { body: JSON.stringify(results), contentType: 'application/json' })`.
|
|
93
|
+
An assertion alone is invisible to a reporter. More in the
|
|
94
|
+
[accessibility guide](https://docs.kinora.dev/guides/reporter/#accessibility).
|
|
95
|
+
|
|
74
96
|
## Documentation
|
|
75
97
|
|
|
76
98
|
Full reporter options, PR/MR comments, CI examples, and self-hosting are in the docs:
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import process from "node:process";
|
|
4
|
-
import { DEFAULT_KINORA_URL, DEFAULT_UPLOAD_ATTACHMENTS, IngestError, a11yFromScans, createIngestClient, detectCiEnv, effectiveAttachments, isUploadableAttachment, makeTestKey, parseAxeScan, postPrComment, resolvePrContext } from "@kinora/core";
|
|
4
|
+
import { DEFAULT_KINORA_URL, DEFAULT_UPLOAD_ATTACHMENTS, IngestError, a11yFromScans, createIngestClient, detectCiEnv, effectiveAttachments, flakyTestsOf, isUploadableAttachment, makeTestKey, parseAxeScan, postPrComment, resolvePrContext } from "@kinora/core";
|
|
5
5
|
//#region src/index.ts
|
|
6
6
|
function identity(test) {
|
|
7
7
|
let file = "";
|
|
@@ -175,7 +175,8 @@ var KinoraReporter = class {
|
|
|
175
175
|
runUrl: res.runUrl,
|
|
176
176
|
ciRunUrl: payload.run.ci?.runUrl,
|
|
177
177
|
counts: payload.run.counts,
|
|
178
|
-
regression: res.regression
|
|
178
|
+
regression: res.regression,
|
|
179
|
+
flaky: flakyTestsOf(payload.tests)
|
|
179
180
|
}, policy ?? "always");
|
|
180
181
|
if (outcome !== "skipped") console.warn(`[kinora] PR comment ${outcome}`);
|
|
181
182
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinora/reporter",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "Playwright reporter that uploads test results to a kinora server",
|
|
6
6
|
"author": "Joris Gallot",
|
|
7
7
|
"license": "MIT",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@kinora/core": "0.
|
|
47
|
+
"@kinora/core": "0.11.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@axe-core/playwright": "^4.13.0",
|
|
51
51
|
"@playwright/test": "^1.64.0",
|
|
52
52
|
"@types/node": "^26.6.5",
|
|
53
|
-
"@vitest/coverage-v8": "^5.0.
|
|
53
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
54
54
|
"tsdown": "^0.23.1",
|
|
55
55
|
"typescript": "~6.0.3",
|
|
56
|
-
"vitest": "^5.0.
|
|
56
|
+
"vitest": "^5.0.4"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsdown",
|