SE701-T5 / Backend

Heroku deployed Node.js backend server developed by Team-5 for the UniForum project associated with the University of Auckland SOFTENG 701 course
https://uni-forum.herokuapp.com/
MIT License
2 stars 18 forks source link

adding feature of user search #35

Closed AlexMiao7 closed 2 years ago

AlexMiao7 commented 2 years ago

Description

Adding three functions for user search by id/name/username using mongoose.

Related Issue

Solves #20

Type of change

How Has This Been Tested?

This schema has not been tested.

Checklist:

For more information, refer to the Contributing Guidelines document.

R055A commented 2 years ago

I will help fix this soon

AlexMiao7 commented 2 years ago

I have left some suggestions.

It is not a good idea to rely on data being manually entered in the database for the tests to pass.

what i was thinking is that I manually inserted some data into the databbase and try if i can search those data by id, and I also try to search some data which does not exist. So what else could I do in order to test the function?

R055A commented 2 years ago

I have left some suggestions. It is not a good idea to rely on data being manually entered in the database for the tests to pass.

what i was thinking is that I manually inserted some data into the databbase and try if i can search those data by id, and I also try to search some data which does not exist. So what else could I do in order to test the function?

The problem with that is new changes have all collection data in the test database wiped before each test and only the test database is used for tests.