@rstest/browser-react 0.9.10 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -233,8 +233,6 @@ Wraps state updates in React's `act()` for proper batching. Automatically manage
233
233
  function act(callback: () => unknown): Promise<void>;
234
234
  ```
235
235
 
236
- > **Note:** For React 17 (which doesn't export `act`), this function falls back to simple async execution.
237
-
238
236
  ### `cleanup()`
239
237
 
240
238
  Unmounts all rendered components and removes their containers from the DOM.
@@ -260,7 +258,7 @@ interface RenderConfiguration {
260
258
 
261
259
  ## Compatibility
262
260
 
263
- - React 17, 18, and 19
261
+ - React >= 18 (React 17 is not supported)
264
262
  - Rstest browser mode (experimental)
265
263
  - Node.js >= 20.19.0
266
264
 
package/dist/act.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../src/act.ts"],"names":[],"mappings":"AAiBA,KAAK,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,WAcX,CAAC"}
1
+ {"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../src/act.ts"],"names":[],"mappings":"AAmBA,KAAK,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,WAcX,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { act, cleanup, configure, render, renderHook } from './pure';
2
- export type { RenderConfiguration, RenderHookOptions, RenderHookResult, RenderOptions, RenderResult, } from './pure';
1
+ import { act, cleanup, configure, render, renderHook } from './pure.js';
2
+ export type { RenderConfiguration, RenderHookOptions, RenderHookResult, RenderOptions, RenderResult, } from './pure.js';
3
3
  export { act, cleanup, configure, render, renderHook };
4
4
  //# sourceMappingURL=index.d.ts.map
package/dist/pure.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { JSXElementConstructor, ReactNode } from 'react';
2
- import { act } from './act';
2
+ import { act } from './act.js';
3
3
  export interface RenderResult {
4
4
  /** The container element the component is rendered into */
5
5
  container: HTMLElement;
package/dist/pure.js CHANGED
@@ -7,7 +7,7 @@ function setActEnvironment(value) {
7
7
  function updateActEnvironment() {
8
8
  setActEnvironment(activeActs > 0);
9
9
  }
10
- const _act = react.act;
10
+ const _act = react.act ?? react.unstable_act;
11
11
  const act = 'function' != typeof _act ? async (callback)=>{
12
12
  await callback();
13
13
  } : async (callback)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/browser-react",
3
- "version": "0.9.10",
3
+ "version": "0.10.1",
4
4
  "description": "React component testing support for Rstest browser mode",
5
5
  "keywords": [
6
6
  "rstest",
@@ -38,19 +38,19 @@
38
38
  "dist"
39
39
  ],
40
40
  "devDependencies": {
41
- "@rslib/core": "0.21.3",
41
+ "@rslib/core": "0.21.5",
42
42
  "@types/react": "^19.2.14",
43
43
  "@types/react-dom": "^19.2.3",
44
- "react": "^19.2.5",
45
- "react-dom": "^19.2.5",
44
+ "react": "^19.2.6",
45
+ "react-dom": "^19.2.6",
46
46
  "typescript": "^6.0.3",
47
- "@rstest/tsconfig": "0.0.1",
48
- "@rstest/core": "0.9.10"
47
+ "@rstest/core": "0.10.1",
48
+ "@rstest/tsconfig": "0.0.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
52
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
53
- "@rstest/core": "^0.9.10"
51
+ "react": "^18.0.0 || ^19.0.0",
52
+ "react-dom": "^18.0.0 || ^19.0.0",
53
+ "@rstest/core": "^0.10.1"
54
54
  },
55
55
  "engines": {
56
56
  "node": "^20.19.0 || >=22.12.0"