Monday, July 10, 2017

What is Mocking?

The process of replacing a module with generic and mostly empty object, called a mock.

Advantages:

  • Isolates our code from its dependencies.
  • Write tests with no knowledge of dependencies.
  • No need to change tests after change of dependencies.
  • Reduces false positives.
  • Tests will be less fragile.
  • Easier for other developers to understand.

No comments:

Post a Comment

Call a function in child component from parent component in React

Consider the following parent component class Parent extends React.Component { constructor(props) { super(props);         thi...