From a958bdaa72365e511c6910b28bd4995505de2223 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:26:22 +0200 Subject: [PATCH 1/3] docs: update readme --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e855faf..ef2cc5d 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,14 @@ ![Rive hero image](https://cdn.rive.app/rive_logo_dark_bg.png) -A React runtime library for [Rive](https://rive.app). +[Rive](https://rive.app) combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites. -This library is a wrapper around the [JS/Wasm runtime](https://github.com/rive-app/rive-wasm), giving full control over the js runtime while providing components and hooks for React applications. +For more information, check out the following resources: + +- [Homepage](https://rive.app/) +- [General Docs](https://rive.app/docs/) +- [React Docs](https://rive.app/docs/runtimes/react/react) +- [Rive Community / Support](https://community.rive.app/c/support/) ## Table of contents From 76fe777fb1312108fd87a67bfeaa63d3a2432805 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:46:06 +0200 Subject: [PATCH 2/3] test: fix assign error --- test/useStateMachine.test.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/useStateMachine.test.tsx b/test/useStateMachine.test.tsx index 74c9398..37fd7bd 100644 --- a/test/useStateMachine.test.tsx +++ b/test/useStateMachine.test.tsx @@ -1,4 +1,3 @@ -import { mocked } from 'jest-mock'; import { renderHook } from '@testing-library/react'; import useStateMachineInput from '../src/hooks/useStateMachineInput'; @@ -35,6 +34,7 @@ function getRiveMock({ const riveMock = new Rive({ canvas: undefined as unknown as HTMLCanvasElement, }); + if (smiInputs) { riveMock.stateMachineInputs = jest.fn().mockReturnValue(smiInputs); } @@ -51,8 +51,6 @@ describe('useStateMachineInput', () => { it('returns null if there is no state machine name', () => { const riveMock = getRiveMock(); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, '', 'testInput') ); @@ -71,10 +69,8 @@ describe('useStateMachineInput', () => { it('returns null if there are no inputs for the state machine', () => { const riveMock = getRiveMock({ smiInputs: [] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => - useStateMachineInput(riveMock as Rive, 'smName', '') + useStateMachineInput(riveMock, 'smName', '') ); expect(result.current).toBeNull(); }); @@ -85,8 +81,6 @@ describe('useStateMachineInput', () => { } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'numInput') ); @@ -99,8 +93,6 @@ describe('useStateMachineInput', () => { } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'boolInput') ); @@ -113,7 +105,6 @@ describe('useStateMachineInput', () => { value: false, } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'boolInput', true) From 3af6b41f1713b2fd81dd3e9bf4c3798ec7549eac Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 20:13:49 +0200 Subject: [PATCH 3/3] chore: testing if it just needs types/node --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9956da5..dee0f8a 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@testing-library/jest-dom": "^5.13.0", "@testing-library/react": "^16.3.0", "@types/jest": "^27.0.3", + "@types/node": "^18.17.0", "@types/offscreencanvas": "^2019.6.4", "@types/react": "^18.0.0", "@types/testing-library__jest-dom": "^5.9.5",