Skip to content

Commit 983be3e

Browse files
committed
chore(deps): upgrade devDependencies to latest
- Upgrade React to v19, Jest to v30, ESLint to v9 - Migrate to ESLint flat config (eslint.config.js) - Remove deprecated react-test-renderer, use RTL for snapshots - Add @testing-library/dom peer dependency - Update babel, webpack, and other dev dependencies
1 parent f24fdf3 commit 983be3e

File tree

8 files changed

+3772
-3538
lines changed

8 files changed

+3772
-3538
lines changed

.eslintrc

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

__tests__/Resizable.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import {render, screen} from '@testing-library/react';
3-
import renderer from 'react-test-renderer';
43
import Resizable from '../lib/Resizable';
54

65
// Helper to simulate drag events on handle elements
@@ -35,8 +34,8 @@ describe('render Resizable', () => {
3534
});
3635

3736
test('snapshot default props', () => {
38-
const tree = renderer.create(<Resizable {...props}>{resizableBoxChildren}</Resizable>).toJSON();
39-
expect(tree).toMatchSnapshot();
37+
const {container} = render(<Resizable {...props}>{resizableBoxChildren}</Resizable>);
38+
expect(container.firstChild).toMatchSnapshot();
4039
});
4140

4241
test('with correct props', () => {

__tests__/ResizableBox.test.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import {render, screen, act} from '@testing-library/react';
3-
import renderer from 'react-test-renderer';
43

54
import ResizableBox from '../lib/ResizableBox';
65
import Resizable from "../lib/Resizable";
@@ -33,8 +32,8 @@ describe('render ResizableBox', () => {
3332
});
3433

3534
test('snapshot default props', () => {
36-
const tree = renderer.create(<ResizableBox {...props}>{children}</ResizableBox>).toJSON();
37-
expect(tree).toMatchSnapshot();
35+
const {container} = render(<ResizableBox {...props}>{children}</ResizableBox>);
36+
expect(container.firstChild).toMatchSnapshot();
3837
});
3938

4039
test('with correct props', () => {
@@ -127,11 +126,8 @@ describe('render ResizableBox', () => {
127126
const {container} = render(<ResizableBox {...props} style={{backgroundColor: 'red'}}>{children}</ResizableBox>);
128127
const divElement = container.querySelector('div');
129128

130-
expect(divElement).toHaveStyle({
131-
width: '50px',
132-
height: '50px',
133-
backgroundColor: 'red'
134-
});
129+
expect(divElement).toHaveStyle({ width: '50px', height: '50px' });
130+
expect(divElement.style.backgroundColor).toBe('red');
135131
});
136132

137133
test('style prop width and height ignored', () => {
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`render Resizable snapshot default props 1`] = `
44
<div
5-
className="test-classname react-resizable"
6-
style={
7-
{
8-
"height": "50px",
9-
"width": "50px",
10-
}
11-
}
5+
class="test-classname react-resizable"
6+
style="width: 50px; height: 50px;"
127
>
138
<span
14-
className="children"
9+
class="children"
1510
/>
1611
<span
17-
className="react-resizable-handle react-resizable-handle-se"
18-
onMouseDown={[Function]}
19-
onMouseUp={[Function]}
20-
onTouchEnd={[Function]}
12+
class="react-resizable-handle react-resizable-handle-se"
2113
/>
2214
<span
23-
className="react-resizable-handle react-resizable-handle-e"
24-
onMouseDown={[Function]}
25-
onMouseUp={[Function]}
26-
onTouchEnd={[Function]}
15+
class="react-resizable-handle react-resizable-handle-e"
2716
/>
2817
</div>
2918
`;
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`render ResizableBox snapshot default props 1`] = `
44
<div
5-
className="react-resizable"
6-
style={
7-
{
8-
"height": "50px",
9-
"width": "50px",
10-
}
11-
}
5+
class="react-resizable"
6+
style="width: 50px; height: 50px;"
127
>
138
<span
14-
className="children"
9+
class="children"
1510
/>
1611
<span
17-
className="test-class-w"
18-
onMouseDown={[Function]}
19-
onMouseUp={[Function]}
20-
onTouchEnd={[Function]}
12+
class="test-class-w"
2113
/>
2214
</div>
2315
`;

eslint.config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const babelParser = require('@babel/eslint-parser');
2+
const reactPlugin = require('eslint-plugin-react');
3+
const jestPlugin = require('eslint-plugin-jest');
4+
const js = require('@eslint/js');
5+
6+
module.exports = [
7+
js.configs.recommended,
8+
{
9+
files: ['**/*.js', '**/*.jsx'],
10+
languageOptions: {
11+
parser: babelParser,
12+
parserOptions: {
13+
requireConfigFile: false,
14+
babelOptions: {
15+
presets: ['@babel/preset-react', '@babel/preset-flow']
16+
}
17+
},
18+
globals: {
19+
// Browser
20+
window: 'readonly',
21+
document: 'readonly',
22+
console: 'readonly',
23+
HTMLElement: 'readonly',
24+
// Node
25+
require: 'readonly',
26+
module: 'readonly',
27+
exports: 'readonly',
28+
__dirname: 'readonly',
29+
process: 'readonly',
30+
global: 'readonly',
31+
// Jest
32+
jest: 'readonly',
33+
describe: 'readonly',
34+
test: 'readonly',
35+
expect: 'readonly',
36+
beforeEach: 'readonly',
37+
afterEach: 'readonly',
38+
it: 'readonly',
39+
// Flow
40+
ReactElement: 'readonly',
41+
ReactClass: 'readonly',
42+
SyntheticEvent: 'readonly',
43+
ClientRect: 'readonly'
44+
}
45+
},
46+
plugins: {
47+
react: reactPlugin,
48+
jest: jestPlugin
49+
},
50+
rules: {
51+
...jestPlugin.configs.recommended.rules,
52+
'strict': 'off',
53+
'quotes': 'off',
54+
'curly': ['warn', 'multi-line'],
55+
'camelcase': 'off',
56+
'comma-dangle': 'off',
57+
'dot-notation': 'off',
58+
'no-console': 'off',
59+
'no-use-before-define': ['warn', 'nofunc'],
60+
'no-underscore-dangle': 'off',
61+
'no-unused-vars': 'off',
62+
'new-cap': 'off',
63+
'react/jsx-uses-vars': 'warn',
64+
'semi': ['warn', 'always']
65+
}
66+
}
67+
];

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,35 @@
3333
},
3434
"homepage": "https://github.com/react-grid-layout/react-resizable",
3535
"devDependencies": {
36-
"@babel/cli": "^7.21.0",
37-
"@babel/core": "^7.21.3",
38-
"@babel/eslint-parser": "^7.21.3",
36+
"@babel/cli": "^7.28.3",
37+
"@babel/core": "^7.28.5",
38+
"@babel/eslint-parser": "^7.28.5",
3939
"@babel/plugin-proposal-class-properties": "^7.18.6",
4040
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
41-
"@babel/preset-env": "^7.20.2",
42-
"@babel/preset-flow": "^7.18.6",
43-
"@babel/preset-react": "^7.18.6",
41+
"@babel/preset-env": "^7.28.5",
42+
"@babel/preset-flow": "^7.27.1",
43+
"@babel/preset-react": "^7.28.5",
44+
"@testing-library/dom": "^10.4.1",
4445
"@testing-library/jest-dom": "^6.1.0",
45-
"@testing-library/react": "^14.0.0",
46+
"@testing-library/react": "^16.3.1",
4647
"@testing-library/user-event": "^14.5.0",
47-
"babel-loader": "^9.1.2",
48-
"cross-env": "^7.0.2",
49-
"css-loader": "^6.7.3",
50-
"eslint": "^8.36.0",
51-
"eslint-plugin-jest": "^27.2.1",
52-
"eslint-plugin-react": "^7.32.2",
48+
"babel-loader": "^10.0.0",
49+
"cross-env": "^10.1.0",
50+
"css-loader": "^7.1.2",
51+
"eslint": "^9.39.2",
52+
"eslint-plugin-jest": "^29.11.3",
53+
"eslint-plugin-react": "^7.37.5",
5354
"flow-bin": "^0.153.0",
54-
"jest": "^29.5.0",
55-
"jest-environment-jsdom": "^29.5.0",
55+
"jest": "^30.2.0",
56+
"jest-environment-jsdom": "^30.2.0",
5657
"lodash": "^4.17.20",
5758
"pre-commit": "^1.1.2",
58-
"react": "^18",
59-
"react-dom": "^18",
60-
"react-test-renderer": "^18",
61-
"style-loader": "^3.3.2",
62-
"webpack": "^5.76.2",
63-
"webpack-cli": "^5.0.1",
64-
"webpack-dev-server": "^4.13.1"
59+
"react": "^19.2.3",
60+
"react-dom": "^19.2.3",
61+
"style-loader": "^4.0.0",
62+
"webpack": "^5.104.1",
63+
"webpack-cli": "^6.0.1",
64+
"webpack-dev-server": "^5.2.2"
6565
},
6666
"dependencies": {
6767
"prop-types": "15.x",

0 commit comments

Comments
 (0)