Skip to content

Commit 73f5a61

Browse files
authored
enhance: @testing-library/react-native should be optional as not everyone uses RN (#3663)
1 parent 0667377 commit 73f5a61

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

.changeset/smooth-rice-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@data-client/test': patch
3+
---
4+
5+
@testing-library/react-native as optional peerDep

packages/img/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@
9090
"devDependencies": {
9191
"@anansi/browserslist-config": "^1.4.2",
9292
"@data-client/react": "workspace:*",
93+
"@testing-library/dom": "^10.4.1",
9394
"@testing-library/react": "^16.1.0",
9495
"@types/jest": "30.0.0",
9596
"@types/node": "^24.0.0",
9697
"@types/react": "19.2.7",
98+
"@types/react-dom": "^19",
9799
"react": "^19.0.0",
100+
"react-dom": "^19.2.1",
98101
"rollup-plugins": "workspace:*"
99102
}
100103
}

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"@react-navigation/native-stack": "^7.2.0",
197197
"@testing-library/dom": "^10.4.0",
198198
"@testing-library/react": "^16.1.0",
199-
"@testing-library/react-native": "^13.0.0",
199+
"@testing-library/react-native": "^13.3.3",
200200
"@types/jest": "30.0.0",
201201
"@types/node": "^24.0.0",
202202
"@types/qs": "^6",

packages/test/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@
117117
"dependencies": {
118118
"@babel/runtime": "^7.20.0",
119119
"@testing-library/dom": "^10.1.0",
120-
"@testing-library/react": "^16.0.0",
121-
"@testing-library/react-native": "^13.0.0"
120+
"@testing-library/react": "^16.0.0"
122121
},
123122
"peerDependencies": {
124123
"@data-client/react": "^0.12.15 || ^0.13.0 || ^0.14.0 || ^0.15.0",
125124
"@testing-library/react-hooks": "^8.0.0",
125+
"@testing-library/react-native": "^13.0.0",
126126
"@types/react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-0 || ^19.0.0",
127127
"@types/react-dom": "*",
128128
"jest": "*",
@@ -135,6 +135,9 @@
135135
"@testing-library/react-hooks": {
136136
"optional": true
137137
},
138+
"@testing-library/react-native": {
139+
"optional": true
140+
},
138141
"@types/react": {
139142
"optional": true
140143
},
@@ -157,6 +160,7 @@
157160
"devDependencies": {
158161
"@anansi/browserslist-config": "^1.4.2",
159162
"@data-client/react": "workspace:*",
163+
"@testing-library/react-native": "^13.0.0",
160164
"@types/jest": "30.0.0",
161165
"@types/node": "^24.0.0",
162166
"@types/react": "19.2.7",

packages/test/src/makeRenderDataClient/renderHookOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { queries } from '@testing-library/dom';
1+
import type { queries } from '@testing-library/dom';
22
import type { Queries, RenderOptions } from '@testing-library/react';
33
import * as ReactDOMClient from 'react-dom/client';
44

packages/vue/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"devDependencies": {
115115
"@anansi/browserslist-config": "^1.4.2",
116116
"@data-client/rest": "workspace:*",
117-
"@data-client/test": "workspace:*",
118117
"@jest/globals": "^30.0.0",
119118
"@js-temporal/polyfill": "^0.5.0",
120119
"@types/jest": "30.0.0",

yarn.lock

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,11 +3304,14 @@ __metadata:
33043304
"@babel/runtime": "npm:^7.20.0"
33053305
"@data-client/endpoint": "workspace:^"
33063306
"@data-client/react": "workspace:*"
3307+
"@testing-library/dom": "npm:^10.4.1"
33073308
"@testing-library/react": "npm:^16.1.0"
33083309
"@types/jest": "npm:30.0.0"
33093310
"@types/node": "npm:^24.0.0"
33103311
"@types/react": "npm:19.2.7"
3312+
"@types/react-dom": "npm:^19"
33113313
react: "npm:^19.0.0"
3314+
react-dom: "npm:^19.2.1"
33123315
rollup-plugins: "workspace:*"
33133316
peerDependencies:
33143317
"@data-client/react": ^0.1.0 || ^0.2.0 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0
@@ -3380,7 +3383,7 @@ __metadata:
33803383
"@react-navigation/native-stack": "npm:^7.2.0"
33813384
"@testing-library/dom": "npm:^10.4.0"
33823385
"@testing-library/react": "npm:^16.1.0"
3383-
"@testing-library/react-native": "npm:^13.0.0"
3386+
"@testing-library/react-native": "npm:^13.3.3"
33843387
"@types/jest": "npm:30.0.0"
33853388
"@types/node": "npm:^24.0.0"
33863389
"@types/qs": "npm:^6"
@@ -3460,6 +3463,7 @@ __metadata:
34603463
peerDependencies:
34613464
"@data-client/react": ^0.12.15 || ^0.13.0 || ^0.14.0 || ^0.15.0
34623465
"@testing-library/react-hooks": ^8.0.0
3466+
"@testing-library/react-native": ^13.0.0
34633467
"@types/react": ^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-0 || ^19.0.0
34643468
"@types/react-dom": "*"
34653469
jest: "*"
@@ -3470,6 +3474,8 @@ __metadata:
34703474
peerDependenciesMeta:
34713475
"@testing-library/react-hooks":
34723476
optional: true
3477+
"@testing-library/react-native":
3478+
optional: true
34733479
"@types/react":
34743480
optional: true
34753481
"@types/react-dom":
@@ -3513,7 +3519,6 @@ __metadata:
35133519
"@babel/runtime": "npm:^7.20.0"
35143520
"@data-client/core": "workspace:^"
35153521
"@data-client/rest": "workspace:*"
3516-
"@data-client/test": "workspace:*"
35173522
"@jest/globals": "npm:^30.0.0"
35183523
"@js-temporal/polyfill": "npm:^0.5.0"
35193524
"@types/jest": "npm:30.0.0"
@@ -7028,7 +7033,7 @@ __metadata:
70287033
languageName: node
70297034
linkType: hard
70307035

7031-
"@testing-library/dom@npm:^10.1.0, @testing-library/dom@npm:^10.4.0":
7036+
"@testing-library/dom@npm:^10.1.0, @testing-library/dom@npm:^10.4.0, @testing-library/dom@npm:^10.4.1":
70327037
version: 10.4.1
70337038
resolution: "@testing-library/dom@npm:10.4.1"
70347039
dependencies:
@@ -7080,7 +7085,7 @@ __metadata:
70807085
languageName: node
70817086
linkType: hard
70827087

7083-
"@testing-library/react-native@npm:13.3.3, @testing-library/react-native@npm:^13.0.0":
7088+
"@testing-library/react-native@npm:13.3.3, @testing-library/react-native@npm:^13.0.0, @testing-library/react-native@npm:^13.3.3":
70847089
version: 13.3.3
70857090
resolution: "@testing-library/react-native@npm:13.3.3"
70867091
dependencies:
@@ -7942,7 +7947,7 @@ __metadata:
79427947
languageName: node
79437948
linkType: hard
79447949

7945-
"@types/react-dom@npm:*, @types/react-dom@npm:19.2.3":
7950+
"@types/react-dom@npm:*, @types/react-dom@npm:19.2.3, @types/react-dom@npm:^19":
79467951
version: 19.2.3
79477952
resolution: "@types/react-dom@npm:19.2.3"
79487953
peerDependencies:
@@ -24497,7 +24502,7 @@ __metadata:
2449724502
languageName: node
2449824503
linkType: hard
2449924504

24500-
"react-dom@npm:19.2.1, react-dom@npm:^19.0.0":
24505+
"react-dom@npm:19.2.1, react-dom@npm:^19.0.0, react-dom@npm:^19.2.1":
2450124506
version: 19.2.1
2450224507
resolution: "react-dom@npm:19.2.1"
2450324508
dependencies:

0 commit comments

Comments
 (0)