fix(react): install missing react-test-renderer dependency (#7675)

When we install @nrwl/react we should also install react-test-renderer.

ISSUES CLOSED: #7578
This commit is contained in:
Nico 2021-11-10 09:47:17 -07:00 committed by GitHub
parent 8f205715ea
commit 6ac6e981cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

2
packages/react/src/generators/init/init.ts Normal file → Executable file
View File

@ -21,6 +21,7 @@ import {
typesReactDomVersion, typesReactDomVersion,
typesReactVersion, typesReactVersion,
testingLibraryReactHooksVersion, testingLibraryReactHooksVersion,
reactTestRendererVersion,
} from '../../utils/versions'; } from '../../utils/versions';
function setDefault(host: Tree) { function setDefault(host: Tree) {
@ -66,6 +67,7 @@ function updateDependencies(host: Tree) {
'@types/react-dom': typesReactDomVersion, '@types/react-dom': typesReactDomVersion,
'@testing-library/react': testingLibraryReactVersion, '@testing-library/react': testingLibraryReactVersion,
'@testing-library/react-hooks': testingLibraryReactHooksVersion, '@testing-library/react-hooks': testingLibraryReactHooksVersion,
'react-test-renderer': reactTestRendererVersion,
} }
); );
} }

1
packages/react/src/utils/versions.ts Normal file → Executable file
View File

@ -25,6 +25,7 @@ export const testingLibraryReactHooksVersion = '7.0.2';
export const reduxjsToolkitVersion = '1.6.2'; export const reduxjsToolkitVersion = '1.6.2';
export const reactReduxVersion = '7.2.5'; export const reactReduxVersion = '7.2.5';
export const reactTestRendererVersion = '17.0.2';
export const eslintPluginImportVersion = '2.25.2'; export const eslintPluginImportVersion = '2.25.2';
export const eslintPluginJsxA11yVersion = '6.4.1'; export const eslintPluginJsxA11yVersion = '6.4.1';