react enzyme
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });
// global config react and enzyme
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { shallow, mount, render } from 'enzyme'
import renderer from 'react-test-renderer'
configure({ adapter: new Adapter() })
global.shallow = shallow
global.mount = mount
global.render = render
global.renderer = renderernpm i --save-dev enzyme enzyme-adapter-react-16
step by step how to fix enzyme-adapter-react-16 not support for React version 17
step one : npm i npm-install-peers -g
step two copy this :
"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
step three: typing in your terminal npm-install-peers
Also in JavaScript:
- palindrome string js
- string comparison in javascript
- ERROR in ./src/app/pages/auth/auth.module.ngfactory.js Module not found: Error: Can't resolve '@angular/material/core/index'
- w3schools json
- adding cors parameters to extjs ajax
- node biology definition
- how to get data in json format in javascript
- includes()
- angular An accessor cannot be declared in an ambient context.
- escape in javascript
- react create array
- react.strictmode
- loop in object javascript
- angular tilt
- useReactiveVar
- refresh data after some time angular
- vuetify event handler
- js url encode
- js what does var mean
- node js store add values in file
- user agents regex for mobile
- get value in tag with id JS
- how to get width of inline elements js
- hoe verbind je de nodemcu 8266 met adafruit io