> Should novice users of THAT level be working on production systems…?
Eric Elliott
584
I believe the comment was misunderstood.
I agree, `beforeEach()` and `afterEach()` are dangerous and should be avoided in favour of a more verbose and isolated method to setup unique state for each test.
personally I opt for the following:
function props(props = {}) {
const defaultProps = {
firstName: ‘Bill’,
lastName: ‘Murray’,
displayName: () => {},
};
return merge({}, defaultProps, props);
}
const element = shallow(<Person {…props({ firstName: ‘Mr Bill’})} />);Just personally, novice devs never get near our production code. But really this is a silly argument as we have no shared definition of “novice coder”. Mute point.