Enzyme returns null for prop on shallow rendered react component
问题 The Issue I am just getting started with enzyme and react testing. I am trying to get enzyme working with karma and webpack on a trivial react component. My issue is that prop() on the wrapper returns null and I am not sure why. Greeter.js import React from 'react'; /* * A trivial component we added while trying to get the react testing working * */ export default class Greeter extends React.Component { constructor(props) { super(props); this.state = { name: props.initialName }; this