|
1 | 1 | # Nodejs Expressjs MongoDB Ready-to-use API Project Structure
|
2 | 2 | A ready-to-use boilerplate for REST API Development with Node.js, Express, and MongoDB
|
| 3 | +[](https://www.linkedin.com/in/maitray-suthar/) [](https://github.com/maitraysuthar/rest-api-nodejs-mongodb/blob/master/LICENSE)   |
| 4 | + |
3 | 5 |
|
4 | 6 | ## Getting started
|
5 | 7 |
|
@@ -54,6 +56,7 @@ npm update
|
54 | 56 | 2. Create a new file by copying and pasting the file and then renaming it to just `.env`
|
55 | 57 | 3. The file `.env` is already ignored, so you never commit your credentials.
|
56 | 58 | 4. Change the values of the file to your environment. Helpful comments added to `.env.example` file to understand the constants.
|
| 59 | +5. Test cases with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/). |
57 | 60 |
|
58 | 61 | ## How to run
|
59 | 62 |
|
@@ -85,6 +88,20 @@ If you need to add more routes to the project just create a new file in `/routes
|
85 | 88 |
|
86 | 89 | If you need to add more controllers to the project just create a new file in `/controllers/` and use them in the routes.
|
87 | 90 |
|
| 91 | +## Tests |
| 92 | + |
| 93 | +### Running Test Cases |
| 94 | + |
| 95 | +```bash |
| 96 | +npm test |
| 97 | +``` |
| 98 | + |
| 99 | +You can set custom command for test at `package.json` file inside `scripts` property. You can also change timeout for each assertion with `--timeout` parameter of mocha command. |
| 100 | + |
| 101 | +### Creating new tests |
| 102 | + |
| 103 | +If you need to add more test cases to the project just create a new file in `/test/` and run the command. |
| 104 | + |
88 | 105 | ## Bugs or improvements
|
89 | 106 |
|
90 | 107 | Every project needs improvements, Feel free to report any bugs or improvements. Pull requests are always welcome.
|
|
0 commit comments