Skip to content

Commit a63cb04

Browse files
authored
Update outdated testing library dependencies (#2968)
1 parent e4514a6 commit a63cb04

File tree

10 files changed

+201
-652
lines changed

10 files changed

+201
-652
lines changed

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,16 @@
4040
"@storybook/react": "^8.4.1",
4141
"@storybook/react-webpack5": "^8.4.1",
4242
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
43-
"@testing-library/jest-dom": "^5.16.4",
44-
"@testing-library/react": "^13.3.0",
45-
"@testing-library/react-hooks": "^8.0.0",
46-
"@testing-library/react-native": "^11.0.0",
43+
"@testing-library/dom": "^10.4.0",
44+
"@testing-library/jest-dom": "^6.6.3",
45+
"@testing-library/react": "^16.0.1",
4746
"@types/fs-extra": "^11.0.3",
4847
"@types/jest": "^29.5.12",
4948
"@types/lodash": "^4.14.149",
5049
"@types/node": "^18.6.1",
5150
"@types/prop-types": "^15.7.5",
5251
"@types/react": "^18.0.15",
5352
"@types/react-dom": "^18.0.6",
54-
"@types/testing-library__jest-dom": "^5.14.5",
55-
"@typescript-eslint/eslint-plugin": "^5.32.0",
56-
"@typescript-eslint/parser": "^5.32.0",
5753
"autoprefixer": "^10.0.1",
5854
"babel-jest": "29.7.0",
5955
"babel-loader": "9.1.3",
@@ -102,7 +98,7 @@
10298
"storybook": "^8.4.1",
10399
"style-loader": "^4.0.0",
104100
"tailwindcss": "^3.3.0",
105-
"ts-jest": "^29.1.2",
101+
"ts-jest": "^29.2.5",
106102
"ts-loader": "^9.3.0",
107103
"ts-node": "^10.9.1",
108104
"typescript": "^4.7.3",

packages/victory-core/src/victory-util/log.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
/* global console */
1+
/* global console process */
22
/* eslint-disable no-console */
33

4-
// TODO: Use "warning" npm module like React is switching to.
54
export function warn(message: string) {
5+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
6+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
67
if (process.env.NODE_ENV !== "production") {
78
if (console && console.warn) {
89
console.warn(message);

packages/victory-native/jest-native-setup.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

packages/victory-native/jest.config.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/victory-native/package.json

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -324,22 +324,9 @@
324324
]
325325
},
326326
"jest": {
327-
"command": "jest",
328-
"files": [
329-
"src/**/*.test.*",
330-
"../../.babelrc.js",
331-
"./jest.config.ts",
332-
"./jest-native-setup.tsx"
333-
],
334-
"output": [],
335-
"dependencies": [
336-
"build:lib:cjs",
337-
"../victory-vendor:build:lib:cjs",
338-
"../victory-voronoi:build:lib:cjs"
339-
],
340-
"packageLocks": [
341-
"pnpm-lock.yaml"
342-
]
327+
"command": "echo \"victory-native (legacy) has no tests\"",
328+
"files": [],
329+
"output": []
343330
}
344331
}
345332
}

packages/victory-native/src/components.test.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

packages/victory-tooltip/src/victory-tooltip.test.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,32 @@ describe("components/victory-tooltip", () => {
2222

2323
it("renders nothing when not active", () => {
2424
render(<VictoryTooltip {...baseProps} active={false} />, {
25-
wrapper: VictoryContainer,
25+
wrapper: VictoryContainer as React.JSXElementConstructor<{
26+
children: React.ReactNode;
27+
}>,
2628
});
2729
const output = screen.queryByTestId(labelId);
2830
expect(output).not.toBeInTheDocument();
2931
});
3032

3133
it("renders the expected text", () => {
32-
render(<VictoryTooltip {...baseProps} />, { wrapper: VictoryContainer });
34+
render(<VictoryTooltip {...baseProps} />, {
35+
wrapper: VictoryContainer as React.JSXElementConstructor<{
36+
children: React.ReactNode;
37+
}>,
38+
});
3339
const output = screen.getByTestId(labelId);
3440
expect(output).toBeInTheDocument();
3541
expect(output).toBeVisible();
3642
expect(output).toHaveTextContent(baseProps.text);
3743
});
3844

3945
it("renders a flyout and a label", () => {
40-
render(<VictoryTooltip {...baseProps} />, { wrapper: VictoryContainer });
46+
render(<VictoryTooltip {...baseProps} />, {
47+
wrapper: VictoryContainer as React.JSXElementConstructor<{
48+
children: React.ReactNode;
49+
}>,
50+
});
4151
const label = screen.getByTestId(labelId);
4252
const flyout = screen.getByTestId(flyoutId);
4353
expect(label).toBeInTheDocument();
@@ -49,7 +59,11 @@ describe("components/victory-tooltip", () => {
4959
const clickHandler = jest.fn();
5060
render(
5161
<VictoryTooltip {...baseProps} events={{ onClick: clickHandler }} />,
52-
{ wrapper: VictoryContainer },
62+
{
63+
wrapper: VictoryContainer as React.JSXElementConstructor<{
64+
children: React.ReactNode;
65+
}>,
66+
},
5367
);
5468
fireEvent.click(screen.getByTestId(flyoutId));
5569
expect(clickHandler).toBeCalled();

0 commit comments

Comments
 (0)