Skip to content

Commit

Permalink
Update jest monorepo to v29 (#564)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
calebeby and renovate[bot] authored Aug 31, 2022
1 parent 5efa46e commit f7eb16e
Show file tree
Hide file tree
Showing 36 changed files with 2,453 additions and 3,309 deletions.
4,707 changes: 1,925 additions & 2,782 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@rollup/plugin-node-resolve": "13.3.0",
"@testing-library/dom": "8.17.1",
"@testing-library/jest-dom": "5.16.5",
"@types/jest": "28.1.1",
"@types/jest": "29.0.0",
"@types/mime": "3.0.1",
"@types/node": "14.18.26",
"@types/polka": "0.5.4",
Expand All @@ -47,14 +47,15 @@
"errorstacks": "2.4.0",
"esbuild-jest": "0.5.0",
"eslint": "8.23.0",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"jest": "29.0.1",
"jest-environment-jsdom": "29.0.1",
"kolorist": "1.5.1",
"liquidjs": "9.39.2",
"magic-string": "0.26.2",
"polka": "0.5.2",
"preact": "10.10.0",
"prettier": "2.7.1",
"pretty-format": "29.0.1",
"prop-types": "15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
24 changes: 12 additions & 12 deletions src/serialize/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('printElement', () => {
outerEl.style.whiteSpace = 'pre';
// eslint-disable-next-line @cloudfour/unicorn/template-indent
expect(printElement(outerEl, false)).toMatchInlineSnapshot(`
"<div style=\\"white-space: pre;\\">
"<div style="white-space: pre;">
first
Expand All @@ -73,7 +73,7 @@ describe('printElement', () => {
outerEl.style.whiteSpace = 'pre-line';
// eslint-disable-next-line @cloudfour/unicorn/template-indent
expect(printElement(outerEl, false)).toMatchInlineSnapshot(`
"<div style=\\"white-space: pre-line;\\">
"<div style="white-space: pre-line;">
first
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('printElement', () => {
const outerEl = document.createElement('div');
outerEl.dataset.asdf = 'foo';
expect(printElement(outerEl, false)).toMatchInlineSnapshot(
`"<div data-asdf=\\"foo\\" />"`,
`"<div data-asdf="foo" />"`,
);
});
it('formats > 2 attributes on multiple lines', () => {
Expand All @@ -132,9 +132,9 @@ describe('printElement', () => {
outerEl.setAttribute('style', 'background: green');
expect(printElement(outerEl, false)).toMatchInlineSnapshot(`
"<div
data-asdf=\\"foo\\"
class=\\"class\\"
style=\\"background: green\\"
data-asdf="foo"
class="class"
style="background: green"
/>"
`);
});
Expand All @@ -146,9 +146,9 @@ describe('printElement', () => {
outerEl.setAttribute('style', 'background: green');
expect(printElement(outerEl, false)).toMatchInlineSnapshot(`
"<div
data-asdf=\\"foo\\"
class=\\"class\\"
style=\\"background: green\\"
data-asdf="foo"
class="class"
style="background: green"
>
content
</div>"
Expand All @@ -159,7 +159,7 @@ describe('printElement', () => {
outerEl.setAttribute('required', '');
outerEl.setAttribute('value', '');
expect(printElement(outerEl, false)).toMatchInlineSnapshot(
`"<input required value=\\"\\" />"`,
`"<input required value="" />"`,
);
});
it('truncates long attributes', () => {
Expand All @@ -169,14 +169,14 @@ describe('printElement', () => {
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
);
expect(printElement(el, false)).toMatchInlineSnapshot(
`"<a href=\\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[...]\\" />"`,
`"<a href="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[...]" />"`,
);
});
it('truncates <path d="..." /> very short', () => {
const el = document.createElement('path');
el.setAttribute('d', 'svgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvgsvg');
expect(printElement(el, false)).toMatchInlineSnapshot(
`"<path d=\\"svgsvgsvgsvgsvgsvgsvgsvgsvgsvg[...]\\" />"`,
`"<path d="svgsvgsvgsvgsvgsvgsvgsvgsvgsvg[...]" />"`,
);
});
});
232 changes: 116 additions & 116 deletions tests/accessibility/toPassAxeTests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,56 @@ test(
`);
await expect(expect(page).toPassAxeTests()).rejects
.toThrowErrorMatchingInlineSnapshot(`
"[2mexpect([22m[31mpage[39m[2m).toPassAxeTests()[22m
Expected page to pass Axe accessibility tests.
Violations found:
[31m[1mImages must have alternate text[22m[39m (image-alt)
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axe-puppeteer
Affected Nodes:
<img />
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\\"
[31m[1mDocument should have one main landmark[22m[39m (landmark-one-main)
https://dequeuniversity.com/rules/axe/4.4/landmark-one-main?application=axe-puppeteer
Affected Nodes:
<html lang=\\"en\\">
<head>[...]</head>
<body>
<img />
</body>
</html>
Fix the following:
• Document does not have a main landmark.
[31m[1mPage should contain a level-one heading[22m[39m (page-has-heading-one)
https://dequeuniversity.com/rules/axe/4.4/page-has-heading-one?application=axe-puppeteer
Affected Nodes:
<html lang=\\"en\\">
<head>[...]</head>
<body>
<img />
</body>
</html>
Fix the following:
• Page must have a level-one heading.
[31m[1mAll page content should be contained by landmarks[22m[39m (region)
https://dequeuniversity.com/rules/axe/4.4/region?application=axe-puppeteer
Affected Nodes:
<img />
Fix the following:
• Some page content is not contained by landmarks
"
"[2mexpect([22m[31mpage[39m[2m).toPassAxeTests()[22m
Expected page to pass Axe accessibility tests.
Violations found:
[31m[1mImages must have alternate text[22m[39m (image-alt)
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axe-puppeteer
Affected Nodes:
<img />
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"
[31m[1mDocument should have one main landmark[22m[39m (landmark-one-main)
https://dequeuniversity.com/rules/axe/4.4/landmark-one-main?application=axe-puppeteer
Affected Nodes:
<html lang="en">
<head>[...]</head>
<body>
<img />
</body>
</html>
Fix the following:
• Document does not have a main landmark.
[31m[1mPage should contain a level-one heading[22m[39m (page-has-heading-one)
https://dequeuniversity.com/rules/axe/4.4/page-has-heading-one?application=axe-puppeteer
Affected Nodes:
<html lang="en">
<head>[...]</head>
<body>
<img />
</body>
</html>
Fix the following:
• Page must have a level-one heading.
[31m[1mAll page content should be contained by landmarks[22m[39m (region)
https://dequeuniversity.com/rules/axe/4.4/region?application=axe-puppeteer
Affected Nodes:
<img />
Fix the following:
• Some page content is not contained by landmarks
"
`);
await expect(page).not.toPassAxeTests();
await expect(page).toPassAxeTests({
Expand Down Expand Up @@ -90,71 +90,71 @@ test(
// This test makes sure that we are still able to find the real HTML in the DOM and use our custom formatting for the HTML
await expect(expect(page).toPassAxeTests()).rejects
.toThrowErrorMatchingInlineSnapshot(`
"[2mexpect([22m[31mpage[39m[2m).toPassAxeTests()[22m
Expected page to pass Axe accessibility tests.
Violations found:
[31m[1mDocument should have one main landmark[22m[39m (landmark-one-main)
https://dequeuniversity.com/rules/axe/4.4/landmark-one-main?application=axe-puppeteer
Affected Nodes:
<html lang=\\"en\\">
<head>[...]</head>
<body>
<svg
viewBox=\\"0 0 24 24\\"
width=\\"24\\"
height=\\"24\\"
class=\\"Icon Icon--large\\"
role=\\"img\\"
>
<path d=\\"M21.79,1H2.21A1.21,1.21,0,0,0,[...]\\" />
</svg>
</body>
</html>
Fix the following:
• Document does not have a main landmark.
[31m[1mPage should contain a level-one heading[22m[39m (page-has-heading-one)
https://dequeuniversity.com/rules/axe/4.4/page-has-heading-one?application=axe-puppeteer
Affected Nodes:
<html lang=\\"en\\">
<head>[...]</head>
<body>
<svg
viewBox=\\"0 0 24 24\\"
width=\\"24\\"
height=\\"24\\"
class=\\"Icon Icon--large\\"
role=\\"img\\"
>
<path d=\\"M21.79,1H2.21A1.21,1.21,0,0,0,[...]\\" />
</svg>
</body>
</html>
Fix the following:
• Page must have a level-one heading.
[31m[1m<svg> elements with an img role must have an alternative text[22m[39m (svg-img-alt)
https://dequeuniversity.com/rules/axe/4.4/svg-img-alt?application=axe-puppeteer
Affected Nodes:
<svg
viewBox=\\"0 0 24 24\\"
width=\\"24\\"
height=\\"24\\"
class=\\"Icon Icon--large\\"
role=\\"img\\"
>
<path d=\\"M21.79,1H2.21A1.21,1.21,0,0,0,[...]\\" />
</svg>
Fix any of the following:
• Element has no child that is a title
• 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
"
`);
"[2mexpect([22m[31mpage[39m[2m).toPassAxeTests()[22m
Expected page to pass Axe accessibility tests.
Violations found:
[31m[1mDocument should have one main landmark[22m[39m (landmark-one-main)
https://dequeuniversity.com/rules/axe/4.4/landmark-one-main?application=axe-puppeteer
Affected Nodes:
<html lang="en">
<head>[...]</head>
<body>
<svg
viewBox="0 0 24 24"
width="24"
height="24"
class="Icon Icon--large"
role="img"
>
<path d="M21.79,1H2.21A1.21,1.21,0,0,0,[...]" />
</svg>
</body>
</html>
Fix the following:
• Document does not have a main landmark.
[31m[1mPage should contain a level-one heading[22m[39m (page-has-heading-one)
https://dequeuniversity.com/rules/axe/4.4/page-has-heading-one?application=axe-puppeteer
Affected Nodes:
<html lang="en">
<head>[...]</head>
<body>
<svg
viewBox="0 0 24 24"
width="24"
height="24"
class="Icon Icon--large"
role="img"
>
<path d="M21.79,1H2.21A1.21,1.21,0,0,0,[...]" />
</svg>
</body>
</html>
Fix the following:
• Page must have a level-one heading.
[31m[1m<svg> elements with an img role must have an alternative text[22m[39m (svg-img-alt)
https://dequeuniversity.com/rules/axe/4.4/svg-img-alt?application=axe-puppeteer
Affected Nodes:
<svg
viewBox="0 0 24 24"
width="24"
height="24"
class="Icon Icon--large"
role="img"
>
<path d="M21.79,1H2.21A1.21,1.21,0,0,0,[...]" />
</svg>
Fix any of the following:
• Element has no child that is a title
• 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
"
`);
}),
);
24 changes: 12 additions & 12 deletions tests/jest-dom-matchers/toBeChecked.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ test(
await expect(inputCheckboxChecked).toBeChecked();
await expect(expect(inputCheckboxChecked).not.toBeChecked()).rejects
.toThrowErrorMatchingInlineSnapshot(`
"[2mexpect([22m[31melement[39m[2m).not.toBeChecked()[22m
"[2mexpect([22m[31melement[39m[2m).not.toBeChecked()[22m
Received element is checked:
[31m<input
type=\\"checkbox\\"
checked
data-testid=\\"input-checkbox-checked\\"
/>[39m"
`);
Received element is checked:
[31m<input
type="checkbox"
checked
data-testid="input-checkbox-checked"
/>[39m"
`);
await expect(inputCheckboxUnchecked).not.toBeChecked();
await expect(expect(inputCheckboxUnchecked).toBeChecked()).rejects
.toThrowErrorMatchingInlineSnapshot(`
"[2mexpect([22m[31melement[39m[2m).toBeChecked()[22m
"[2mexpect([22m[31melement[39m[2m).toBeChecked()[22m
Received element is not checked:
[31m<input type=\\"checkbox\\" data-testid=\\"input-checkbox-unchecked\\" />[39m"
`);
Received element is not checked:
[31m<input type="checkbox" data-testid="input-checkbox-unchecked" />[39m"
`);
await expect(ariaCheckboxChecked).toBeChecked();
await expect(ariaCheckboxUnchecked).not.toBeChecked();

Expand Down
Loading

0 comments on commit f7eb16e

Please sign in to comment.