Skip to the portion for your preferred programming language:
-
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 "Backend App" option.
-
In the new Terminal window, type:
npm run dev
-
When you see this message, the Backend app is now running and you can now use the To Do List Backend API.
-
To access the app, open
docs/todo.http
file in the code editor (just click on it).We will be using the REST Client extension to check the Backend REST API endpoints.
Click on the "Send Request" link to do the API call. The response & result will show up in a "Response" tab.
Here are the API calls you can make:
GET /todos
- will return a JSON array of To Do Items.POST /todos
- will create a new To Do Item.PUT /todos/{{task_id}}
- will update an existing To Do Item with atask_id
.DELETE /todos/{{task_id}}
- will delete To Do Item with atask_id
.
-
To stop the app, click into the Terminal where we started the Backend App (in step 4) and press
Ctrl
+c
. This will stop the Backend App.Note: Stopping the app will clear all the To Do List items in the database.
There are 2 ways to run the Unit Tests for the "Backend 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-app-js
>test
-
On the row with
todo-app-js
label, 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 "Backend App" option.
-
In the new Terminal window, type:
npm run test
-
You should see this display if all the tests are passing:
-
Click on the "Explorer" icon on the left sidebar.
-
Click on "Backend App" to see all the folders under this workspace.
-
The application code can be found in
Backend App
directory.- Can you figure out how we display the To Do list?
-
The test code can be found in
Backend App
>test
.- Can you figure out what the test code mean?
-
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 "Backend App" option.
-
In the new Terminal window, type:
make run
-
When you see this message, the Backend app is now running and you can now use the To Do List Backend API.
-
To access the app, open
docs/todo.http
file in the code editor (just click on it).We will be using the REST Client extension to check the Backend REST API endpoints.
Click on the "Send Request" link to do the API call. The response & result will show up in a "Response" tab.
Here are the API calls you can make:
GET /todos
- will return a JSON array of To Do Items.POST /todos
- will create a new To Do Item.PUT /todos/{{task_id}}
- will update an existing To Do Item with atask_id
.DELETE /todos/{{task_id}}
- will delete To Do Item with atask_id
.
-
To stop the app, click into the Terminal where we started the Backend App (in step 4) and press
Ctrl
+c
. This will stop the Backend App.Note: Stopping the app will clear all the To Do List items in the database.
There are 2 ways to run the Unit Tests for the Frontend App:
Using the Test Explorer.
-
Click on the "Testing" icon on the left sidebar.
-
First, we need to configure the Python testing in VSCode.
Press
ctrl
+shift
+p
(windows) /cmd
+shift
+p
(macOS) to bring up the Command Palette.Next, type:
pytest
You should see this option show up in the Command Palette:
-
In the list of workspaces, select the "Backend App".
-
Next select the "pytest" Test Framework
-
Next select the "Root directory" as the directory containing the tests.
-
You should see the Python tests appear in the "Test Explorer".
-
Open up all the tests in
Python Tests
>todo-app-python
>test_todos.py
-
On the row with
todo-app-python
label, 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 "Backend App" option.
-
In the new Terminal window, type:
make test
-
You should see this display if all the tests are passing:
-
Click on the "Explorer" icon on the left sidebar.
-
Click on "Backend App" to see all the folders under this workspace.
-
The application code can be found in
Backend App
directory.- Can you figure out how we display the To Do list?
-
The test code can be found in
Backend App
>test_todos.py
.- Can you figure out what the test code mean?
-
Open the "Backend App" workspace.
-
Open this file:
src/main/java/com/tddworkshops/todolist/TodolistApplication.java
-
Click on "Run" at the top right hand corner.
-
If you see this option, its due to Gradle importing all the dependencies.
-
If you see these text in th your terminal, the "Backend App" is running now.
-
To access the app, open
docs/todo.http
file in the code editor (just click on it).We will be using the REST Client extension to check the Backend REST API endpoints.
Click on the "Send Request" link to do the API call. The response & result will show up in a "Response" tab.
Here are the API calls you can make:
GET /todos
- will return a JSON array of To Do Items.POST /todos
- will create a new To Do Item.PUT /todos/{{task_id}}
- will update an existing To Do Item with atask_id
.DELETE /todos/{{task_id}}
- will delete To Do Item with atask_id
.
-
To stop the app, click into the "Stop button". This will stop the Backend App.
Note: Stopping the app will clear all the To Do List items in the database.
-
Click on the "Testing" icon on the left sidebar.
-
Open up all the tests in
Java Test
>todolist-todo-app-java
-
On the row with
todolist-todo-app-java
label, 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.
-
Click on the "Explorer" icon on the left sidebar.
-
Click on "Backend App" to see all the folders under this workspace.
-
The application code can be found in
main
directory.- Can you figure out how we display the To Do list?
-
The test code can be found in
test
directory.- Can you figure out what the test code mean?