When we write tests for small individual components like a function or a file of the entire code base, that’s Unit Testing. For writing unit tests, we’ll pick up one functionality/logic and mock the bits on which that one functionality depends.
This might be sounding absurd.
However, read along, this will make sense in just a minute.
For understanding what I meant by mocking, we’ll have to first understand testing in general.
setTimeout() method as the name suggests calls a function after the specified time.
Or does it?
But before anything else, syntax. Below is the syntax of setTimeout() which is evaluating the function and logs out ‘Hello!’ after 3 seconds(3000 milliseconds).
Now, let’s run a simple code and see how should setTimeout() work
Disclaimer: This is probably one of the most useless articles you will come across. This is basically me just explaining myself how to make a CSS button with a gradient border(more details below). If you want to understand that(or maybe want the code for it) feel free to go further.
Backstory(that no one asked for apparently): I wanted to make a Button for a website with border-gradient and transparent background with curved border and I wasn’t able to find fuss-free code for it, so here’s me making one for myself. …
“Guys, I want #DevFestKol to trend on Twitter,” said Shuvam. You may say that’s a little too much to ask, maybe, but that was not the reply of the outreach team of DevFest Kolkata’19. The origin of this story goes long back.
It all started when a month ago (fine, not that way back) when Shuvam, one of the organisers of the event as well as my senior, texted me, “Hey, I need you for a really important work, I want you to prepare the sponsorship pitch deck for DevFest and write an article about the DevFests in general and…
Fresh into college, fresh into the club and it begins with #IndiaBuildsActions!
For a beginner like me, “Intents” meant Purpose, “fulfilment” was not more than an achievement of something but I came to know there is much more to words than just dictionary meanings.
With just the basic knowledge in programming, it was a bit daunting at first. Building an action that people could talk to, seemed like a lot of intense coding skills would be required for it, turned out there was much more to it than just coding. We had already seen the Heritage Helper in action and…