But for, uh, this demo, we'll just quickly now move on to VS code. And first let's basically go to this particular link for the docs. So as you can see, like you can either install the Pony code VS code extension or the CLI or you can also use it as a GitHub action, and it's free, free to use for individual developers.
So if you click on the VS code extension and install it inside of your VS code, it will look something like this. So if you're basically using, uh, you can see that it will basically, uh, show up over here as this Pony Code icon inside of your VS code. And you can take a look at some of the things that has the getting started page. Uh, and this basically shows you how to very quickly get started and generate a unit test cases inside of your application.
So, uh, the one that we're going to be using is the Pony Code VS code extension. So in this case, uh, in my file directory, I have created a Pony Code, um, folder. And over here, what I've done is I've just created a simple index.cs file, and I have just created a simple function for adding two numbers. So first let's take a look how this will basically So, um, as soon as you basically write any function, uh, Pony Code will automatically be able to detect the function that you have written, like a JavaScript function. And over here, you can directly see that, uh, we get this, uh, UI graphical user interface where you can see that we can click on this, uh, Pony Code unit test, which will basically generate a UI, um, platform. And you can see that it basically comes up with some suggestions for unit test cases that you can basically write.
So we, you can see that these are the suggestions being provided by Pony Code in order for you to, let's say, increase your test coverage. So let's say that, uh, I want to probably take this example of A and B. Basically, since it's an add to numbers function, we are having two variables and here it takes these two values. So what I can very easily do is that either I can test this particular function. And see that, you know, uh, it basically just generates the response and I can actually click on the plus sign. If I want to basically add this particular specific test case inside of my, uh, Pony Code. And what it immediately does is that now we have a new folder in place and this folder is the Pony Code folder. So if I go and explore this Pony Code folder, you can see that it is the index.ts.js file. So this is an automated, automatically created, uh, test generation file that has been created by Pony Code. So if we basically take a look at, like, you know, what it includes, right. So you can see that, uh, it has, first of all, what it does, it has done. Is that it has, uh, like, you know, imported our index.js file and now it has basically described a function, uh, index.addToNumbers because that's a function that we like, you know, have from our index.js file that we have created and we have generated a over here where it is, uh, like, you know, getting to these two values. Now, let's say if we want to add some additional test cases, we can very easily just click on the UI, uh, on the Pony Code UI and add that. So that will basically automatically get added, uh, inside of your index.test.js function. As you can see that we have another, uh, like, you know, function, another function that we have added, another test case that we have added. So this way you can either remove or delete, uh, these test cases and automatically the unit test that is being generated for you, uh, will be changed. Now let's also take an example for an async function.
Comments