Skip to content

Commit bb58106

Browse files
committed
chore: new deps and fix test
1 parent be8790f commit bb58106

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
},
3636
"homepage": "https://github.com/rive-app/rive-react#readme",
3737
"dependencies": {
38-
"@rive-app/canvas": "2.31.1",
39-
"@rive-app/canvas-lite": "2.31.1",
40-
"@rive-app/webgl": "2.31.1",
41-
"@rive-app/webgl2": "2.31.1"
38+
"@rive-app/canvas": "2.31.0",
39+
"@rive-app/canvas-lite": "2.31.0",
40+
"@rive-app/webgl": "2.31.0",
41+
"@rive-app/webgl2": "2.31.0"
4242
},
4343
"peerDependencies": {
4444
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
@@ -47,34 +47,33 @@
4747
"@babel/core": "^7.18.0",
4848
"@testing-library/jest-dom": "^5.13.0",
4949
"@testing-library/react": "^16.3.0",
50-
"@types/jest": "^29.5.14",
51-
"@types/node": "^18.19.122",
50+
"@types/jest": "^27.0.3",
5251
"@types/offscreencanvas": "^2019.6.4",
5352
"@types/react": "^18.0.0",
5453
"@types/testing-library__jest-dom": "^5.9.5",
55-
"@typescript-eslint/eslint-plugin": "^5.7.0",
56-
"@typescript-eslint/parser": "^5.7.0",
54+
"@typescript-eslint/eslint-plugin": "^6.21.0",
55+
"@typescript-eslint/parser": "^6.21.0",
5756
"auto-changelog": "^2.3.0",
5857
"babel-loader": "^8.2.5",
5958
"bunchee": "1.8.5",
60-
"eslint": "^7.28.0",
59+
"eslint": "^8.57.1",
6160
"eslint-config-prettier": "^8.3.0",
62-
"eslint-config-standard": "^16.0.3",
61+
"eslint-config-standard": "^17.1.0",
6362
"eslint-plugin-import": "^2.23.4",
6463
"eslint-plugin-node": "^11.1.0",
6564
"eslint-plugin-prettier": "^3.4.0",
66-
"eslint-plugin-promise": "^5.1.0",
65+
"eslint-plugin-promise": "^6.6.0",
6766
"eslint-plugin-react": "^7.27.1",
6867
"eslint-plugin-react-hooks": "^4.6.0",
6968
"eslint-plugin-storybook": "^0.5.12",
70-
"jest": "^29.7.0",
71-
"jest-environment-jsdom": "^29.7.0",
69+
"jest": "^27.0.4",
70+
"jest-mock": "^30.0.5",
7271
"prettier": "^2.3.1",
7372
"react": "^18.0.0",
7473
"react-dom": "^18.0.0",
7574
"release-it": "^14.10.0",
76-
"ts-jest": "^29.4.1",
77-
"typescript": "^5.9.2",
75+
"ts-jest": "^27.1.1",
76+
"typescript": "^4.5.4",
7877
"watch": "^1.0.2"
7978
}
80-
}
79+
}

test/useStateMachine.test.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { mocked } from 'jest-mock';
21
import { renderHook } from '@testing-library/react';
32

43
import useStateMachineInput from '../src/hooks/useStateMachineInput';
@@ -35,6 +34,7 @@ function getRiveMock({
3534
const riveMock = new Rive({
3635
canvas: undefined as unknown as HTMLCanvasElement,
3736
});
37+
3838
if (smiInputs) {
3939
riveMock.stateMachineInputs = jest.fn().mockReturnValue(smiInputs);
4040
}
@@ -51,8 +51,6 @@ describe('useStateMachineInput', () => {
5151
it('returns null if there is no state machine name', () => {
5252
const riveMock = getRiveMock();
5353

54-
mocked(Rive).mockImplementation(() => riveMock);
55-
5654
const { result } = renderHook(() =>
5755
useStateMachineInput(riveMock, '', 'testInput')
5856
);
@@ -71,10 +69,8 @@ describe('useStateMachineInput', () => {
7169
it('returns null if there are no inputs for the state machine', () => {
7270
const riveMock = getRiveMock({ smiInputs: [] });
7371

74-
mocked(Rive).mockImplementation(() => riveMock);
75-
7672
const { result } = renderHook(() =>
77-
useStateMachineInput(riveMock as Rive, 'smName', '')
73+
useStateMachineInput(riveMock, 'smName', '')
7874
);
7975
expect(result.current).toBeNull();
8076
});
@@ -85,8 +81,6 @@ describe('useStateMachineInput', () => {
8581
} as StateMachineInput;
8682
const riveMock = getRiveMock({ smiInputs: [smInput] });
8783

88-
mocked(Rive).mockImplementation(() => riveMock);
89-
9084
const { result } = renderHook(() =>
9185
useStateMachineInput(riveMock, 'smName', 'numInput')
9286
);
@@ -99,8 +93,6 @@ describe('useStateMachineInput', () => {
9993
} as StateMachineInput;
10094
const riveMock = getRiveMock({ smiInputs: [smInput] });
10195

102-
mocked(Rive).mockImplementation(() => riveMock);
103-
10496
const { result } = renderHook(() =>
10597
useStateMachineInput(riveMock, 'smName', 'boolInput')
10698
);
@@ -113,7 +105,6 @@ describe('useStateMachineInput', () => {
113105
value: false,
114106
} as StateMachineInput;
115107
const riveMock = getRiveMock({ smiInputs: [smInput] });
116-
mocked(Rive).mockImplementation(() => riveMock);
117108

118109
const { result } = renderHook(() =>
119110
useStateMachineInput(riveMock, 'smName', 'boolInput', true)

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"declaration": true,
44
"esModuleInterop": true,
55
"jsx": "react",
6-
"lib": ["esnext", "dom", "esnext.disposable"],
6+
"lib": ["esnext", "dom"],
77
"module": "commonjs",
88
"moduleResolution": "node",
99
"noImplicitAny": true,

0 commit comments

Comments
 (0)