-
Click on the "Terminal" tab
-
Click on "+" (on the far right of the tab bar) to create a "New Terminal Session".
-
If you opened the workspace from Exercise 3, you will be presented with a list of directories. Select the "Frontend App" option.
-
In the new Terminal window, type:
npm run dev -
When you see this message, the Frontend app is now running and you can now access the To Do List application.
-
You will also see this prompt. Click on "Open in Browser" to view the application in a separate browser tab.
-
You should see this in the new browser tab:
Note: The To Do List app is not working now because we have not started the Backend App.
-
To stop the app, click into the Terminal where we started the Frontend App (in step 4) and press
Ctrl+c. This will stop the Frontend App.
There are 2 ways to run the Unit Tests for the "Frontend App":
- Using the Test Explorer.
- This method is convenient when you are using VSCode and you can use your mouse to click on the test button.
- In the Terminal.
- This method is recommended when you are running the test in Continuous Integration (CI) pipelines.
Using the Test Explorer.
-
Click on the "Testing" icon on the left sidebar.
-
Open up all the tests in
Vitest>todo-frontend>test -
On the row with
todo-frontendlabel, click on the "Play" button to run the unit tests. -
You should see a bunch of green ticks to signify that all the tests are passing.
-
In the "Terminal" tab, click on "+" (on the far right of the tab bar) to create a "New Terminal Session".
-
If you opened the workspace from Exercise 3, you will be presented with a list of directories. Select the "Frontend App" option.
-
In the new Terminal window, type:
npm run testnpmstands for Node Package Manager. It is a package manager for JavaScript programming language.runis a command to run a script in thepackage.jsonfile.testis the script name in thepackage.jsonfile.
-
You should see this display if all the tests are passing:
-
Click on the "Explorer" icon on the left sidebar.
-
Click on "Frontend App" to see all the folders under this workspace.
-
The application code can be found in
Frontend App>src.- Can you figure out how we display the To Do list?
- Where are we making the network API call to the backend server?
-
The test code can be found in
Frontend App>test.- Can you figure out what the code mean?











