Skip to content

Commit 2732180

Browse files
committed
Test with react@17 through a script updating dependencies
1 parent 80308d4 commit 2732180

File tree

7 files changed

+18
-6057
lines changed

7 files changed

+18
-6057
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
key: dependencies-{{ checksum "yarn.lock" }}
3131
paths:
3232
- ~/.cache/yarn
33-
- run: yarn setup:react:17
3433
- persist_to_workspace:
3534
root: .
3635
paths:

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@
8383
"build:ts:watch": "yarn build:ts --watch --preserveWatchOutput",
8484
"build": "yarn clean && yarn build:js && yarn build:ts && yarn copy-flowtypes",
8585
"prepare": "yarn build",
86-
"setup:react:17": "del react-17-tests/src react-17-tests/jest-preset && cp -R src jestSetup.js jest-preset babel.config.js react-17-tests/ && cd react-17-tests && yarn",
87-
"test:react:17": "cd react-17-tests && yarn test"
86+
"test:react:17": "scripts/test_react_17"
8887
},
8988
"jest": {
9089
"preset": "./jest-preset",
@@ -93,8 +92,7 @@
9392
],
9493
"testPathIgnorePatterns": [
9594
"timerUtils",
96-
"examples/",
97-
"react-17-tests"
95+
"examples/"
9896
],
9997
"testTimeout": 60000,
10098
"transformIgnorePatterns": [

react-17-tests/.gitignore

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

react-17-tests/package.json

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

react-17-tests/yarn.lock

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

scripts/test_react_17

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh -e
2+
3+
cp yarn.lock tmp.yarn.lock
4+
cp package.json tmp.package.json
5+
6+
7+
yarn test
8+
9+
mv tmp.package.json package.json
10+
mv tmp.yarn.lock yarn.lock

src/__tests__/render.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ test('debug changing component', () => {
205205
test('renders options.wrapper around node', () => {
206206
type WrapperComponentProps = { children: React.ReactNode };
207207
const WrapperComponent = ({ children }: WrapperComponentProps) => (
208-
<SafeAreaView testID="wrapper">{children}</SafeAreaView>
208+
<View testID="wrapper">{children}</View>
209209
);
210210

211211
const { toJSON, getByTestId } = render(<View testID="inner" />, {
@@ -214,20 +214,20 @@ test('renders options.wrapper around node', () => {
214214

215215
expect(getByTestId('wrapper')).toBeTruthy();
216216
expect(toJSON()).toMatchInlineSnapshot(`
217-
<RCTSafeAreaView
217+
<View
218218
testID="wrapper"
219219
>
220220
<View
221221
testID="inner"
222222
/>
223-
</RCTSafeAreaView>
223+
</View>
224224
`);
225225
});
226226

227227
test('renders options.wrapper around updated node', () => {
228228
type WrapperComponentProps = { children: React.ReactNode };
229229
const WrapperComponent = ({ children }: WrapperComponentProps) => (
230-
<SafeAreaView testID="wrapper">{children}</SafeAreaView>
230+
<View testID="wrapper">{children}</View>
231231
);
232232

233233
const { toJSON, getByTestId, rerender } = render(<View testID="inner" />, {
@@ -240,15 +240,15 @@ test('renders options.wrapper around updated node', () => {
240240

241241
expect(getByTestId('wrapper')).toBeTruthy();
242242
expect(toJSON()).toMatchInlineSnapshot(`
243-
<RCTSafeAreaView
243+
<View
244244
testID="wrapper"
245245
>
246246
<View
247247
accessibilityHint="test"
248248
accessibilityLabel="test"
249249
testID="inner"
250250
/>
251-
</RCTSafeAreaView>
251+
</View>
252252
`);
253253
});
254254

0 commit comments

Comments
 (0)