@cbrl/testing 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/a11y.mjs +7 -6
  2. package/package.json +7 -7
package/dist/a11y.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { axe, toHaveNoViolations } from "jest-axe";
2
- import { expect } from "vitest";
2
+ import { assert } from "vitest";
3
3
  // src/vitest/a11y.ts
4
4
  /**
5
5
  * Shared accessibility assertion for jsdom component tests, backed by axe-core
@@ -10,13 +10,14 @@ import { expect } from "vitest";
10
10
  * const { container } = render(<Button>Salvar</Button>)
11
11
  * await expectNoA11yViolations(container)
12
12
  *
13
- * The jest-axe matcher is registered once here so callers only deal with the
14
- * wrapper — no per-file `expect.extend` and no matcher type augmentation.
15
- * Requires a DOM environment (`environment: 'jsdom'`).
13
+ * The jest-axe matcher runs directly instead of through `expect.extend`, so
14
+ * importing this module has no side effects and needs no matcher type
15
+ * augmentation (Vitest 5 no longer merges jest-axe's `jest.Matchers` typings
16
+ * into `Assertion`). Requires a DOM environment (`environment: 'jsdom'`).
16
17
  */
17
- expect.extend(toHaveNoViolations);
18
18
  async function expectNoA11yViolations(container) {
19
19
  const results = await axe(container, { rules: { region: { enabled: false } } });
20
- expect(results).toHaveNoViolations();
20
+ const result = toHaveNoViolations.toHaveNoViolations(results);
21
+ assert(result.pass, result.message());
21
22
  }
22
23
  export { expectNoA11yViolations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbrl/testing",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Test helpers: Vitest coverage base, server-only shim, jsdom polyfills, jest-axe a11y matcher, and Playwright E2E/smoke presets.",
5
5
  "license": "MIT",
6
6
  "author": "Kayron Cabral",
@@ -46,16 +46,16 @@
46
46
  "@arethetypeswrong/cli": "^0.18.5",
47
47
  "@playwright/test": "^1.56.1",
48
48
  "@types/jest-axe": "^3.5.9",
49
- "@types/node": "^25.6.2",
50
- "@vitest/coverage-v8": "^4.1.6",
49
+ "@types/node": "^26.6.6",
50
+ "@vitest/coverage-v8": "^5.1.1",
51
51
  "eslint": "^9.39.4",
52
52
  "jsdom": "^29.1.1",
53
53
  "publint": "^0.3.25",
54
54
  "tsdown": "^0.23.7",
55
- "typescript": "^5.9.3",
56
- "vitest": "^4.1.6",
57
- "@cbrl/eslint-config": "0.2.0",
58
- "@cbrl/tsconfig": "0.1.0"
55
+ "typescript": "^6.0.3",
56
+ "vitest": "^5.1.1",
57
+ "@cbrl/eslint-config": "0.2.1",
58
+ "@cbrl/tsconfig": "0.1.1"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"