1
-
2
1
# Contributing to Real Dev Squad API
3
2
4
3
- [ Getting Started] ( #getting-started )
@@ -25,19 +24,22 @@ The script associated with `npm run test` will run all tests that ensures that y
25
24
repository. This will run the lint, integration and unit tests.
26
25
27
26
##### ` npm run lint `
27
+
28
28
Runs the lint checks in the project.
29
29
30
30
##### ` npm run generate-api-schema `
31
+
31
32
Generates the API schema in the file ` public/apiSchema.json ` .
32
33
33
34
##### ` npm run validate-setup `
34
- Runs the test for checking local development setup is working properly or not.
35
35
36
+ Runs the test for checking local development setup is working properly or not.
36
37
37
38
## Project Structure
39
+
38
40
The following project structure should be followed:
39
41
40
- ``` shell script
42
+ ``` shell script
41
43
| -- website-backend
42
44
| -- config
43
45
| | -- custom-environment-variables.js
@@ -89,6 +91,7 @@ The following project structure should be followed:
89
91
` ` `
90
92
91
93
# # Generating Authentication Token
94
+
92
95
- Run the project locally, make sure the server is listening to requests
93
96
- Navigate to ` https://github.com/login/oauth/authorize? client_id=< GITHUB_CLIENT_ID> `
94
97
- Authorize the application
@@ -97,8 +100,8 @@ The following project structure should be followed:
97
100
- For non-production environments, authentication is also supported with the `Authorization` header.
98
101
- Authorization header: `Authorization: Bearer <token>`
99
102
100
-
101
103
## Testing Guidelines
104
+
102
105
- Libraries used in testing in the project:
103
106
- [mocha](https://mochajs.org/): Test framework
104
107
- [chai](https://www.chaijs.com/): Assertion library
@@ -110,6 +113,7 @@ The following project structure should be followed:
110
113
- Java version 1.8 or higher.
111
114
112
115
## Using Firebase Emulator Locally
116
+
113
117
- [Firebase Local Emulator Suite](https://firebase.google.com/docs/emulator-suite) can be used locally as the DB for the project
114
118
- Pre-requisites:
115
119
- Node.js version 8.0 or higher.
@@ -119,15 +123,18 @@ The following project structure should be followed:
119
123
- [Future] You can view the emulator UI at: `http://localhost:4000`
120
124
121
125
## Running test scripts on Windows
126
+
122
127
- Git Bash is recommended for running test scripts on Windows.
123
128
- Run `npm run test-integration` for running integration tests.
124
129
- Run `npm run test-unit` for running unit tests.
125
- - Make sure to close the emulator window after running the tests in order to avoid the blocking of the port for the next tests to run.
130
+ - Make sure the server is not running.
131
+ - Make sure to close the emulator window after running the tests in order to avoid the blocking of the port for the next tests to run.
126
132
- For e.g - After running the integration tests, close the emulator window and then run the command for unit tests.
127
133
128
134
## Pull request guidelines
135
+
129
136
- Ensure that the tests pass locally before raising a PR.
130
137
- All pull requests should have base as the develop branch.
131
138
- Every pull request should have associated issue(s) on our [issue tracker](https://github.com/Real-Dev-Squad/website-backend/issues).
132
139
- For any non-trivial fixes and features, unit and integration tests must be added. The PR reviewer should not approve/merge PR(s) that lack these.
133
- - The PR(s) should be merged only after the CI passes.
140
+ - The PR(s) should be merged only after the CI passes.
0 commit comments