Skip to content

Commit

Permalink
Why the test part is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
FC-Viiiiictor-K committed Jun 3, 2024
1 parent 2a6247b commit 60621d3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions reports/final-report-34.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@ Search results are displayed in a card format, including user and event informat

### 3. Tests

We have unit tests for the backend. We used `jest` and `supertest` to implement these tests. To run the tests, you can use the following command:

```bash
cd server
npm test
```

Note that since the unit tests involve login, directly running `npm test` may result in test failures since the port is occupied. To avoid such issues, you may use the following command instead:

```bash
cd server
npm test src/test/user.test.js
npm test src/test/event.test.js
npm test src/test/comments.test.js
```

The cover rate of `user.test.js` is 38%, `event.test.js` is 42%, and `comments.test.js` is 41%.

The unit tests only check the basic functionality of the backend, and most of the tested functions are `GET` or `DELETE`. To fully ensure the correctness of the backend, we also conducted manual tests.

Our manual tests used the api-doc that were automatically generated by `swagger`. We firstly login as admin or an ordinary user, then we manually fill in the parameters and click the `Try it out` button to test the correctness of the backend. We tested all the APIs in the api-doc, including `GET`, `POST`, `PUT`, and `DELETE`. We also tested the APIs with invalid parameters to check the error handling of the backend.

### 4. Build

### 5. Deployment
Expand Down

0 comments on commit 60621d3

Please sign in to comment.