diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ed6c53f9..eae25a946 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,13 @@ jobs: - store_artifacts: path: coverage destination: coverage + test:react:17: + <<: *defaults + steps: + - attach_workspace: + at: ~/react-native-testing-library + - run: | + yarn test:ci:react:17 test-website: <<: *defaults steps: @@ -91,6 +98,9 @@ workflows: - tests: requires: - install-dependencies + - test:react:17: + requires: + - install-dependencies - test-website: requires: - install-dependencies diff --git a/package.json b/package.json index bd45983e0..809854915 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "clean": "del build", "test": "jest", "test:ci": "jest --maxWorkers=2", + "test:ci:react:17": "scripts/test_react_17", "typecheck": "tsc", "flow": "flow", "copy-flowtypes": "cp typings/index.flow.js build", diff --git a/scripts/test_react_17 b/scripts/test_react_17 new file mode 100755 index 000000000..a767e86b8 --- /dev/null +++ b/scripts/test_react_17 @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +cp yarn.lock yarn.lock.backup +cp package.json package.json.backup + +yarn add -D react@17.0.2 react-test-renderer@17.0.2 react-native@0.68.3 --ignore-scripts +yarn test:ci + +mv package.json.backup package.json +mv yarn.lock.backup yarn.lock + +yarn --ignore-scripts diff --git a/src/__tests__/render.test.tsx b/src/__tests__/render.test.tsx index d328abe92..2452e8417 100644 --- a/src/__tests__/render.test.tsx +++ b/src/__tests__/render.test.tsx @@ -205,7 +205,7 @@ test('debug changing component', () => { test('renders options.wrapper around node', () => { type WrapperComponentProps = { children: React.ReactNode }; const WrapperComponent = ({ children }: WrapperComponentProps) => ( - {children} + {children} ); const { toJSON, getByTestId } = render(, { @@ -214,20 +214,20 @@ test('renders options.wrapper around node', () => { expect(getByTestId('wrapper')).toBeTruthy(); expect(toJSON()).toMatchInlineSnapshot(` - - + `); }); test('renders options.wrapper around updated node', () => { type WrapperComponentProps = { children: React.ReactNode }; const WrapperComponent = ({ children }: WrapperComponentProps) => ( - {children} + {children} ); const { toJSON, getByTestId, rerender } = render(, { @@ -240,7 +240,7 @@ test('renders options.wrapper around updated node', () => { expect(getByTestId('wrapper')).toBeTruthy(); expect(toJSON()).toMatchInlineSnapshot(` - { accessibilityLabel="test" testID="inner" /> - + `); });