Wednesday, July 26, 2017

How would you try to save or print a string with escape like this '\' ?

Today I got an issue working with a file path which contains '\' I wanted to save it to the database but I was unable to do.

The path is "C:\Narendra\Work"

Later I tried as "C:\\Narendra\\Work"

Tuesday, July 25, 2017

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.

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...