{"id":45167833,"url":"https://github.com/accesslint/vitest","last_synced_at":"2026-02-23T10:00:57.789Z","repository":{"id":338912339,"uuid":"1159678456","full_name":"AccessLint/vitest","owner":"AccessLint","description":"Accessibility assertions for Vitest — toBeAccessible() matcher powered by AccessLint","archived":false,"fork":false,"pushed_at":"2026-02-20T00:44:36.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T09:33:38.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AccessLint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-17T02:51:34.000Z","updated_at":"2026-02-20T00:44:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AccessLint/vitest","commit_stats":null,"previous_names":["accesslint/vitest"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/AccessLint/vitest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fvitest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fvitest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fvitest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fvitest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AccessLint","download_url":"https://codeload.github.com/AccessLint/vitest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fvitest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-20T07:30:35.926Z","updated_at":"2026-02-23T10:00:57.780Z","avatar_url":"https://github.com/AccessLint.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @accesslint/vitest\n\nAccessibility assertions for Vitest. Adds a `toBeAccessible()` matcher powered by [AccessLint](https://www.accesslint.com?ref=readme_vitest) that checks for WCAG 2.1 Level A and AA violations.\n\n## Installation\n\n```sh\nnpm install --save-dev @accesslint/vitest\n```\n\n`vitest` \u003e= 2.0 is required as a peer dependency.\n\n## Setup\n\nAdd `@accesslint/vitest` as a setup file in your Vitest config:\n\n```ts\n// vitest.config.ts\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    setupFiles: [\"@accesslint/vitest\"],\n  },\n});\n```\n\nThis automatically registers the `toBeAccessible()` matcher.\n\n### Manual registration\n\nIf you prefer to register the matcher yourself:\n\n```ts\nimport { accesslintMatchers } from \"@accesslint/vitest/matchers\";\nimport { expect } from \"vitest\";\n\nexpect.extend(accesslintMatchers);\n```\n\n## Usage\n\nPass any DOM `Element` to `expect()` and call `toBeAccessible()`:\n\n```ts\nconst container = document.createElement(\"div\");\ncontainer.innerHTML = '\u003cimg src=\"photo.jpg\" alt=\"A photo\"\u003e';\n\nexpect(container).toBeAccessible();\n```\n\nThe matcher scopes violations to descendants of the element you pass, so you can test components in isolation.\n\n### Disabling rules\n\nTo ignore specific rules, pass `disabledRules`:\n\n```ts\nexpect(container).toBeAccessible({\n  disabledRules: [\"color-contrast\"],\n});\n```\n\n### Failure messages\n\nWhen violations are found, the matcher reports each one with its rule ID, WCAG level, success criterion, description, and the selector of the offending element:\n\n```\nExpected element to have no accessibility violations, but found 2:\n\n  img-alt [A] (1.1.1): Images must have alternate text\n    img\n\n  color-contrast [AA] (1.4.3): Text must have sufficient color contrast\n    p.subtitle\n```\n\n## What it checks\n\nThe matcher runs 92 WCAG 2.1 Level A and AA rules via `@accesslint/core`, covering images, forms, ARIA attributes, color contrast, landmarks, links, tables, document language, and more.\n\n## TypeScript\n\nTypes are included. Importing the package augments Vitest's `expect` with `toBeAccessible()` automatically.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccesslint%2Fvitest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccesslint%2Fvitest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccesslint%2Fvitest/lists"}