Skip to content

Commit

Permalink
chore: jest 29 (#4303)
Browse files Browse the repository at this point in the history
* chore(deps): upgrade jest to 29

* fix: jest
  • Loading branch information
tenstad authored Dec 29, 2024
1 parent 1bec439 commit 70008c6
Show file tree
Hide file tree
Showing 9 changed files with 1,255 additions and 746 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: [["@babel/preset-env", { targets: { node: "current" } }]],
plugins: [["babel-plugin-styled-components", { displayName: true }]],
};
25 changes: 25 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Config } from "jest";

const config: Config = {
preset: "ts-jest",
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/ui/lib/fileMock.js",
"\\.(css|less)$": "<rootDir>/ui/lib/fileMock.js",
},
transform: {
"\\.tsx?$": "ts-jest",
"\\.jsx?$": [
"babel-jest",
{
configFile: "./babel.config.js",
},
],
},
transformIgnorePatterns: ["/node_modules/(?!(yaml)/)"],
setupFilesAfterEnv: ["<rootDir>/setup-jest.ts"],
modulePathIgnorePatterns: ["<rootDir>/dist/"],
testEnvironment: "jsdom",
};

export default config;
25 changes: 7 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"http-proxy-middleware": "^2.0.3",
"install": "^0.13.0",
"jest-canvas-mock": "^2.4.0",
"jest-worker": "^27.5.1",
"js-sha3": "0.8.0",
"lodash": "^4.17.21",
"luxon": "^3.2.1",
Expand All @@ -83,20 +82,6 @@
"styled-components": "^5.3.0",
"yaml": "^2.2.2"
},
"jest": {
"preset": "ts-jest",
"moduleNameMapper": {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/ui/lib/fileMock.js",
"\\.(css|less)$": "<rootDir>/ui/lib/fileMock.js"
},
"setupFilesAfterEnv": [
"<rootDir>/setup-jest.ts"
],
"modulePathIgnorePatterns": [
"<rootDir>/dist/"
],
"testEnvironment": "jsdom"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
Expand All @@ -108,7 +93,7 @@
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.7",
"@testing-library/react-hooks": "^6.0.0",
"@types/jest": "^27.0.2",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.14.165",
"@types/luxon": "^1.26.5",
"@types/react": "^17.0.6",
Expand All @@ -117,19 +102,23 @@
"@types/styled-components": "^5.1.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"babel-jest": "^29.7.0",
"babel-plugin-styled-components": "^2.1.4",
"buffer": "^5.7.1",
"eslint": "^8.48.0",
"eslint-plugin-import": "^2.25.4",
"jest": "^27.3.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fail-on-console": "^3.3.1",
"jest-styled-components": "^7.0.4",
"jest-worker": "^29.7.0",
"jsdom": "^16.6.0",
"parcel": "^2.13.3",
"prettier": "^2.6.2",
"process": "^0.11.10",
"react-test-renderer": "^17.0.2",
"ts-jest": "^27.1.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"yarn-audit-fix": "^10.0.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ exports[`DataTable snapshots renders 1`] = `
</button>
<div
style={
Object {
{
"width": "16px",
}
}
Expand Down Expand Up @@ -471,7 +471,7 @@ exports[`DataTable snapshots renders 1`] = `
</button>
<div
style={
Object {
{
"width": "16px",
}
}
Expand Down Expand Up @@ -513,7 +513,7 @@ exports[`DataTable snapshots renders 1`] = `
</button>
<div
style={
Object {
{
"width": "16px",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ exports[`SyncActions snapshots non-suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -771,7 +771,7 @@ exports[`SyncActions snapshots non-suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down Expand Up @@ -1254,7 +1254,7 @@ exports[`SyncActions snapshots suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label Mui-disabled css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -1321,7 +1321,7 @@ exports[`SyncActions snapshots suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label Mui-disabled css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ exports[`SyncControls snapshots allButtonsDisabled 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label Mui-disabled css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -378,7 +378,7 @@ exports[`SyncControls snapshots allButtonsDisabled 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label Mui-disabled css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down Expand Up @@ -851,7 +851,7 @@ exports[`SyncControls snapshots hasTooltipSuffix 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -917,7 +917,7 @@ exports[`SyncControls snapshots hasTooltipSuffix 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down Expand Up @@ -1341,7 +1341,7 @@ exports[`SyncControls snapshots hideSuspend 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -1407,7 +1407,7 @@ exports[`SyncControls snapshots hideSuspend 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down Expand Up @@ -2158,7 +2158,7 @@ exports[`SyncControls snapshots non-suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
with Source
</span>
Expand Down Expand Up @@ -2224,7 +2224,7 @@ exports[`SyncControls snapshots non-suspended 1`] = `
</span>
<span
className="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1lw54ax-MuiTypography-root"
style={Object {}}
style={{}}
>
without Source
</span>
Expand Down
14 changes: 7 additions & 7 deletions ui/components/__tests__/__snapshots__/YamlView.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ exports[`YamlView snapshots renders 1`] = `
<div
onClick={[Function]}
style={
Object {
{
"cursor": "pointer",
}
}
Expand Down Expand Up @@ -203,7 +203,7 @@ exports[`YamlView snapshots renders 1`] = `
<div
onClick={[Function]}
style={
Object {
{
"cursor": "pointer",
}
}
Expand All @@ -227,7 +227,7 @@ exports[`YamlView snapshots renders 1`] = `
</div>
<pre
style={
Object {
{
"MozHyphens": "none",
"MozTabSize": "4",
"OTabSize": "4",
Expand Down Expand Up @@ -255,23 +255,23 @@ exports[`YamlView snapshots renders 1`] = `
>
<code
style={
Object {
{
"whiteSpace": "pre",
"wordBreak": "break-word",
}
}
>
<span
style={
Object {
{
"textWrap": "wrap",
}
}
>
<span
className="linenumber react-syntax-highlighter-line-number"
style={
Object {
{
"color": "slategray",
"display": "inline-block",
"minWidth": "1.25em",
Expand All @@ -284,7 +284,7 @@ exports[`YamlView snapshots renders 1`] = `
1
</span>
<span
style={Object {}}
style={{}}
>
yaml\\nyaml\\nyaml\\n
</span>
Expand Down
Loading

0 comments on commit 70008c6

Please sign in to comment.