{"_id":"jasmine-axe","_rev":"2-e37d05c8b8c5649ab9cc7582783426e6","name":"jasmine-axe","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"jasmine-axe","version":"1.0.0","license":"MIT","angular-cli":{},"scripts":{"build":"tsc"},"main":"./index.js","types":"./index.d.ts","dependencies":{"axe-core":"^4.1.3","lodash.merge":"^4.6.2"},"devDependencies":{"@types/jasmine":"^3.6.4","@types/lodash.merge":"^4.6.6","typescript":"^4.2.3"},"description":"Custom Jasmine matcher for aXe for testing accessibility","repository":{"type":"git","url":"git+https://github.com/theodo/jasmine-axe.git"},"keywords":["jasmine","accessibility","axe","a11y"],"author":{"name":"Mathilde Duboille"},"bugs":{"url":"https://github.com/theodo/jasmine-axe/issues"},"homepage":"https://github.com/theodo/jasmine-axe#readme","gitHead":"2e1868cc758c79626396d5f30e64abee434375b7","_id":"jasmine-axe@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-eZ2L5zZjQgHwfUEsRMFUYY2fdWZrq2BwTb69q73UvV4Z6Gl+3Q6rV90NbRV02VBO3TeHqIF4WLHFU3wRPVfreA==","shasum":"13966f5cf87436760cd0fde3748cae648749b80b","tarball":"https://registry.npmjs.org/jasmine-axe/-/jasmine-axe-1.0.0.tgz","fileCount":6,"unpackedSize":15221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQlnlCRA9TVsSAnZWagAATh4P/iqdIRiSvXP1T/Vu1pEW\n71FnYQQwP6hHWF+ZZsFVZVpY9iwjxISeZiwhAu/eUyFWsqUz/eRM1Vg+9Ccb\nVUkxvds4hU/7doygvEWtsvtzK17HsiNgAxtC3mAnQ7bdNJMGEfoxDahaJseS\nRichKkAklqE5jHog3PgwCIurYdED0L7StR7Qscv+EDzZCvreM2lXmfLTPKMs\nJoAg5mJRlcMyb61mdIeA9PuWCi1MxN/7QZFBFVH0TtvI3bCA8gv5o4fWQ4Jk\nBc6fd9kkcpADoBeyISpffIG6O+OXaL7/q5Afk+SID8wkz03mVtwpWeM0ZuRD\nnNu6fcUgro/JqVrHxbnuPGRkbIKnDXOVqZHrosDd5IzEhELkWRxWHmZELN7K\nCS4j/MBMnrRGz7xQTlK8JE71zMUdL+DrBRh1mUXH18hgg6/wDS96SpadsTjr\nsQxCb2VJ09qSsxicQUZlkZOrhFJRrb5mTpKbZKqQfNbPerTFmtcHOp4wysLN\nQKx41ebjFXc5Ed70NuwEQDjpUp2/9ihVQvCsOpW8SLTFIIxsqOFCWg4XJp0w\nfyZH2dTSfrCcCEHdMX1OalKPVGHwLFM5VXJD9JxZIAZ8uNumyTt6dm8wmENL\naQXJKzn5OH8P1koEs8aqzW4z7nuHA+iuvl08r8bvrXqTXLVPPWTOChC1YPd1\nTUpx\r\n=td8Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJYYgF8Sf2XYSswBeniVf/aTj4fbZjJntu1RORaXYsowIhAITROMSSKnhpTlg2gdQ14jhr0oZViwYqCHQs9bPYrZFn"}]},"_npmUser":{"name":"alberict","email":"alberict@theodo.fr"},"directories":{},"maintainers":[{"name":"alberict","email":"alberict@theodo.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jasmine-axe_1.0.0_1614961124924_0.7390547585320015"},"_hasShrinkwrap":false},"1.1.0":{"name":"jasmine-axe","version":"1.1.0","license":"MIT","angular-cli":{},"scripts":{"build":"tsc"},"main":"./index.js","types":"./index.d.ts","dependencies":{"axe-core":"^4.1.3","lodash.merge":"^4.6.2"},"devDependencies":{"@types/jasmine":"^3.6.4","@types/lodash.merge":"^4.6.6","typescript":"^4.2.3"},"description":"Custom Jasmine matcher for aXe for testing accessibility","repository":{"type":"git","url":"git+https://github.com/theodo/jasmine-axe.git"},"keywords":["jasmine","accessibility","axe","a11y"],"author":{"name":"Mathilde Duboille"},"bugs":{"url":"https://github.com/theodo/jasmine-axe/issues"},"homepage":"https://github.com/theodo/jasmine-axe#readme","gitHead":"fcbdfff865ace2aa6e01b7c59546699197116511","_id":"jasmine-axe@1.1.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-t3uCFU1oUHVUyWNeOgG4F/3rnatMJDGFQrybUldFaApUuirR6B6JGjXOlin5pzA5cd8zvBli33Kb27UlTNRcjw==","shasum":"7bef9c0bd2764f21735459b4cc0e54dd24cd1a0a","tarball":"https://registry.npmjs.org/jasmine-axe/-/jasmine-axe-1.1.0.tgz","fileCount":7,"unpackedSize":20614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsKvyCRA9TVsSAnZWagAAck8P/3ZZdNwDpohQKLH+8d+T\n66GND5Jg3ji6r0pOQKG4d6x1uSQ7uaUqxYjxLC8waBDD+zJ/Er0nUQ1TaWNq\niAWw5VfbDEMFoOPhSYdj0PBxE5Ly/f/w/AIxn/0oQ4eHLckxsuaUCaH2pPYj\nRChkMSvfAe+o7SqmTpkZhQKeuIeJOPUTyxWtqZiZHEFA3+iA9Bw59NNyXYV0\nSfqxBpsAHBmxu0nR0dGUGig+W/6K4MNk+qtB2Lkg5htQxfUvTXORWf+zC756\nz/AclbF2CTCIG1J6lvM5sEjv4XLkbIevIKemQDfEJUs9uNEbb+MmkT7JGX+N\nRb8eh4jaRFhC53UgcRKXk7sGmwuZ49nnbNZXfFoQr0D3boRmeVkdrZB53rH+\nbwzDoL9Fo7LxHcnquTvtAREbBqDvSvlKscsM6dXWt1xy29cgPhIW13KzqRE2\n/BAI8Llr4CV9U090G6emMNY6mHBebZDQDPWKtmmZ1IaMj/fpNYYwXzuSKj2O\nUGQd9fQXXVD9k/0i4RBr1w00UYY5NntqzXNGlrXu8zxIiXx5FgS/wQZrJlmL\nwl6Y+pi5mhW0mOxa688440IL+Ut8xd80dZKkRpoo5DmxuEc/WrE2czTfybwj\nSH6Typ5OsVqFX/obCl0RhQPCZbBn4m3/oPTSvVOJBOQ4jWBYFGjcTUuBNOXw\nCgBs\r\n=1pYX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFoj556DRaLR7VA3C1q1SHE299zYRrnXVHs5wftlWMAIAiB0DSKEcH62uqicn/yT7zMHHXBfbsDC/XEDPngh5CsAjA=="}]},"_npmUser":{"name":"alberict","email":"alberict@theodo.fr"},"directories":{},"maintainers":[{"name":"alberict","email":"alberict@theodo.fr"},{"name":"emvo","email":"emylyv@theodo.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jasmine-axe_1.1.0_1622191089594_0.5674300711916045"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-05T16:18:44.923Z","1.0.0":"2021-03-05T16:18:45.111Z","modified":"2022-05-06T10:12:40.910Z","1.1.0":"2021-05-28T08:38:09.773Z"},"maintainers":[{"name":"alberict","email":"alberict@theodo.fr"},{"name":"emvo","email":"emylyv@theodo.fr"}],"description":"Custom Jasmine matcher for aXe for testing accessibility","homepage":"https://github.com/theodo/jasmine-axe#readme","keywords":["jasmine","accessibility","axe","a11y"],"repository":{"type":"git","url":"git+https://github.com/theodo/jasmine-axe.git"},"author":{"name":"Mathilde Duboille"},"bugs":{"url":"https://github.com/theodo/jasmine-axe/issues"},"license":"MIT","readme":"# jasmine-axe\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\n[![npm version](https://img.shields.io/npm/v/jasmine-axe.svg)](https://www.npmjs.com/package/jasmine-axe)\n\nCustom [Jasmine](https://jasmine.github.io/) matcher for [aXe](https://github.com/dequelabs/axe-core) for testing accessibility\n\n## Installation:\n\n```bash\nnpm install --save-dev jasmine-axe\n```\n\n## Usage:\n\n```javascript\nimport { TestBed } from \"@angular/core/testing\";\nimport { axe, toHaveNoViolations } from \"jasmine-axe\";\nimport TestComponent from \"./TestComponent.component\";\n\ndescribe(\"TestComponent\", () => {\n  beforeEach(() => {\n    TestBed.configureTestingModule({\n      declarations: [TestComponent],\n    });\n    TestBed.compileComponents();\n    jasmine.addMatchers(toHaveNoViolations);\n  });\n\n  it(\"should pass accessibility test\", async () => {\n    const fixture = TestBed.createComponent(TestComponent);\n    expect(await axe(fixture.nativeElement)).toHaveNoViolations();\n  });\n});\n```\n\nIf you want to add an accessibility check on an existing project, you will probably find many accessibility issues, and you may not have time to fix them right away.\nInstead of skipping the test until you have time to fix the issues, you can use another matcher `toHaveLessThanXViolations`. You will be able to prevent new accessibility issues to appear.\nThis matcher should be use as a temporary fix, the objective is of course to have no violations at all.\n```javascript\nimport { TestBed } from \"@angular/core/testing\";\nimport { axe, toHaveLessThanXViolations } from \"jasmine-axe\";\nimport TestComponent from \"./TestComponent.component\";\n\ndescribe(\"TestComponent\", () => {\n  beforeEach(() => {\n    TestBed.configureTestingModule({\n      declarations: [TestComponent],\n    });\n    TestBed.compileComponents();\n    jasmine.addMatchers(toHaveLessThanXViolations);\n  });\n\n  it(\"should have less than 2 accessibility issues\", async () => {\n    const fixture = TestBed.createComponent(TestComponent);\n    expect(await axe(fixture.nativeElement)).toHaveLessThanXViolations(2);\n  });\n});\n```\n\n### Axe configuration\n\nThe `axe` function allows options to be set with the [same options as documented in axe-core](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter):\n\n```javascript\nimport { axe, toHaveNoViolations } from \"jasmine-axe\";\n\ndescribe(\"TestComponent\", () => {\n  beforeEach(() => {\n    TestBed.configureTestingModule({\n      declarations: [],\n    });\n    TestBed.compileComponents();\n    jasmine.addMatchers(toHaveNoViolations);\n  });\n\n  it(\"should demonstrate this matcher`s usage with a custom config\", async () => {\n    const render = () => `\n        <div>\n            <img src=\"#\"/>\n        </div>\n    `;\n    const html = render();\n\n    const results = await axe(html, {\n      rules: {\n        // for demonstration only, don't disable rules that need fixing.\n        \"image-alt\": { enabled: false },\n      },\n    });\n    expect(results).toHaveNoViolations();\n  });\n});\n```\n\n## Setting global configuration\n\nIf you find yourself repeating the same options multiple times, you can export a version of the `axe` function with defaults set.\n\nNote: You can still pass additional options to this new instance; they will be merged with the defaults.\n\nThe configuration object passed to `configureAxe` also accepts a `globalOptions` property to configure the format of the data used by axe and to add custom checks and rules. The property value is the same as the parameter passed to [axe.configure](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#parameters-1).\n\n```javascript\n// Global helper file (axe-helper.js)\nimport { configureAxe } from \"jasmine-axe\";\n\nconst axe = configureAxe({\n  rules: {\n    // for demonstration only, don't disable rules that need fixing.\n    \"image-alt\": { enabled: false },\n  },\n  globalOptions: {\n    checks: [\n      /* custom checks definitions */\n    ],\n  },\n});\n\nexport default axe;\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/MathildeDuboille\"><img src=\"https://avatars.githubusercontent.com/u/35567446?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>MathildeDuboille</b></sub></a><br /><a href=\"#a11y-MathildeDuboille\" title=\"Accessibility\">️️️️♿️</a> <a href=\"https://github.com/theodo/jasmine-axe/commits?author=MathildeDuboille\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"http://alberic.trancart.net/\"><img src=\"https://avatars.githubusercontent.com/u/6317823?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Albéric Trancart</b></sub></a><br /><a href=\"#a11y-AlbericTrancart\" title=\"Accessibility\">️️️️♿️</a> <a href=\"https://github.com/theodo/jasmine-axe/commits?author=AlbericTrancart\" title=\"Code\">💻</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","readmeFilename":"README.md"}