Why my module does not get mocked as expected in Jest?

One of the reasons for this issue can be the order of statements. E.g, if you have mocked a module at line #5, but there are some other require statements at line #1,2,3,4, then it may be the case that the same module is used in those required modules (at line #1,2,3,4).

How to use LESS preprocessor in React’s create-react-app

Using LESS or SASS has become the de facto standard for front end development and React is the preferred frontend framework these days. A question is asked frequently on how we can enable LESS/SASS/STYLUS in React project. The easiest way to do it is using custom-react-scripts. This adds the support for SASS/LESS/STYLUS and decorators in …

Why Passport with Local Strategy is hanging on Authentication

If you are using custom callback for authentication using PassportjsĀ for Local Database Authentication, you may encounter the situation that the Post request hangs and the authentication never seems to end. There may be many reasons but what we’ve found most common is we are using passport.authenticate() middleware in a callback but do not provide (req, …

How to Delete a remote Git tag

You probably won’t need to do this often, but just in case you happen to, here is how to delete a tag from a remote Git repository. If you have a tag named ‘tag123’ then you would just do this: This will remove ‘tag123’ from the remote repository.