Skip to content

Commit

Permalink
Merge pull request #257 from NickColley/update-all-the-things
Browse files Browse the repository at this point in the history
Update all the things
  • Loading branch information
NickColley authored Nov 2, 2022
2 parents e123392 + 94f7d4a commit 3d0759e
Show file tree
Hide file tree
Showing 11 changed files with 7,706 additions and 4,263 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [10, 12, 14]
node-version: [14, 16, 18]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
16
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 7.0.0

Update main dependencies:
- axe-core from version 4.4.1 to 4.5.1 - thanks [@jbchr](https://github.com/jbchr).
- chalk updated from version 4.1.0 to 4.1.2
- jest-matcher-utils updated from version 27.0.2 to 29.2.2

Breaking changes:
- axe-core includes new rules and checks which may need to be fixed or turned off
- axe-core help messages updates will change your snapshot output
- no longer support Node.js 10 and 12

# 6.0.1

- [Fix "Not implemented: window.computedStyle(elt, pseudoElt)" errors](https://github.com/NickColley/jest-axe/pull/252/commits/48824b2400b23bf2ff11bcccd090cf868b4fd8ec).

# 6.0.0

- Update axe-core to version 4.4.1 - thanks [@dafnem1](https://github.com/dafnem1).
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You'll also need to:

## Installation:
```bash
npm install --save-dev jest-axe
npm install --save-dev jest jest-axe jest-environment-jsdom
```

[TypeScript](https://www.typescriptlang.org/) users can install the community maintained types package:
Expand All @@ -30,6 +30,9 @@ npm install --save-dev @types/jest-axe
## Usage:

```javascript
/**
* @jest-environment jsdom
*/
const { axe, toHaveNoViolations } = require('jest-axe')

expect.extend(toHaveNoViolations)
Expand Down
88 changes: 44 additions & 44 deletions __tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,57 @@ exports[`jest-axe readme first readme example should demonstrate this matcher\`s
Expected the HTML found at $('img') to have no violations:
<img src=\\"#\\">
<img src="#">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/image-alt?application=axeAPI
────────
Expected the HTML found at $('img') to have no violations:
<img src=\\"#\\">
<img src="#">
Received:
\\"All page content should be contained by landmarks (region)\\"
"All page content should be contained by landmarks (region)"
Fix any of the following:
Some page content is not contained by landmarks
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI"
https://dequeuniversity.com/rules/axe/4.5/region?application=axeAPI"
`;
exports[`jest-axe toHaveNoViolations returns correctly formatted message when violations are present 1`] = `
"expect(received).toHaveNoViolations(expected)
Expected the HTML found at $('body > img') to have no violations:
<img src=\\"\\">
<img src="">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible
Element has no title attribute or the title attribute is empty
Element's default semantics were not overridden with role=\\"presentation\\"
Element's default semantics were not overridden with role=\\"none\\"
Element's default semantics were not overridden with role="presentation"
Element's default semantics were not overridden with role="none"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/2.6/image-alt?application=axeAPI"
Expand All @@ -64,51 +64,51 @@ https://dequeuniversity.com/rules/axe/2.6/image-alt?application=axeAPI"
exports[`jest-axe toHaveNoViolations returns properly formatted text with more complex example 1`] = `
"expect(received).toHaveNoViolations(expected)
Expected the HTML found at $('img[src$=\\"example.com\\"]') to have no violations:
Expected the HTML found at $('img[src$="example.com"]') to have no violations:
<img src=\\"http://example.com\\">
<img src="http://example.com">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/image-alt?application=axeAPI
Expected the HTML found at $('img[src=\\"http://example.com/2\\"]') to have no violations:
Expected the HTML found at $('img[src="http://example.com/2"]') to have no violations:
<img src=\\"http://example.com/2\\">
<img src="http://example.com/2">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/image-alt?application=axeAPI
────────
Expected the HTML found at $('input') to have no violations:
<input type=\\"text\\">
<input type="text">
Received:
\\"Form elements must have labels (label)\\"
"Form elements must have labels (label)"
Fix any of the following:
Form element does not have an implicit (wrapped) <label>
Expand All @@ -117,20 +117,20 @@ Fix any of the following:
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element has no placeholder attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/label?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/label?application=axeAPI
────────
Expected the HTML found at $('a[href$=\\"#link-name\\"]') to have no violations:
Expected the HTML found at $('a[href$="#link-name"]') to have no violations:
<a href=\\"#link-name\\"></a>
<a href="#link-name"></a>
Received:
\\"Links must have discernible text (link-name)\\"
"Links must have discernible text (link-name)"
Fix all of the following:
Element is in tab order and does not have accessible text
Expand All @@ -142,15 +142,15 @@ Fix any of the following:
Element has no title attribute
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/link-name?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/link-name?application=axeAPI
Expected the HTML found at $('a[href$=\\"#link-name-2\\"]') to have no violations:
Expected the HTML found at $('a[href$="#link-name-2"]') to have no violations:
<a href=\\"#link-name-2\\"></a>
<a href="#link-name-2"></a>
Received:
\\"Links must have discernible text (link-name)\\"
"Links must have discernible text (link-name)"
Fix all of the following:
Element is in tab order and does not have accessible text
Expand All @@ -162,49 +162,49 @@ Fix any of the following:
Element has no title attribute
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/link-name?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/link-name?application=axeAPI
────────
Expected the HTML found at $('img[src$=\\"example.com\\"]') to have no violations:
Expected the HTML found at $('img[src$="example.com"]') to have no violations:
<img src=\\"http://example.com\\">
<img src="http://example.com">
Received:
\\"All page content should be contained by landmarks (region)\\"
"All page content should be contained by landmarks (region)"
Fix any of the following:
Some page content is not contained by landmarks
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/region?application=axeAPI
Expected the HTML found at $('img[src=\\"http://example.com/2\\"]') to have no violations:
Expected the HTML found at $('img[src="http://example.com/2"]') to have no violations:
<img src=\\"http://example.com/2\\">
<img src="http://example.com/2">
Received:
\\"All page content should be contained by landmarks (region)\\"
"All page content should be contained by landmarks (region)"
Fix any of the following:
Some page content is not contained by landmarks
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/region?application=axeAPI
Expected the HTML found at $('input') to have no violations:
<input type=\\"text\\">
<input type="text">
Received:
\\"All page content should be contained by landmarks (region)\\"
"All page content should be contained by landmarks (region)"
Fix any of the following:
Some page content is not contained by landmarks
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI"
https://dequeuniversity.com/rules/axe/4.5/region?application=axeAPI"
`;
22 changes: 11 additions & 11 deletions __tests__/__snapshots__/reactjs.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,57 @@ exports[`React renders a react testing library container correctly 1`] = `
Expected the HTML found at $('img') to have no violations:
<img src=\\"#\\">
<img src="#">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI"
https://dequeuniversity.com/rules/axe/4.5/image-alt?application=axeAPI"
`;
exports[`React renders correctly 1`] = `
"expect(received).toHaveNoViolations(expected)
Expected the HTML found at $('img') to have no violations:
<img src=\\"#\\" data-reactroot=\\"\\">
<img src="#">
Received:
\\"Images must have alternate text (image-alt)\\"
"Images must have alternate text (image-alt)"
Fix any of the following:
Element does not have an alt attribute
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element's default semantics were not overridden with role=\\"none\\" or role=\\"presentation\\"
Element's default semantics were not overridden with role="none" or role="presentation"
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI
https://dequeuniversity.com/rules/axe/4.5/image-alt?application=axeAPI
────────
Expected the HTML found at $('img') to have no violations:
<img src=\\"#\\" data-reactroot=\\"\\">
<img src="#">
Received:
\\"All page content should be contained by landmarks (region)\\"
"All page content should be contained by landmarks (region)"
Fix any of the following:
Some page content is not contained by landmarks
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI"
https://dequeuniversity.com/rules/axe/4.5/region?application=axeAPI"
`;
Loading

0 comments on commit 3d0759e

Please sign in to comment.