File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -160,20 +160,16 @@ higher. If you experience errors, please upgrade your version of Node.js.
160160
161161## Testing
162162
163- The default testing framework is Mocha, though you can use whatever you want.
164- Make sure you have it installed:
163+ The default testing framework is Jest, though you can use whatever you want.
165164
166- ```
167- npm install -g mocha
168- ```
169-
170- Tests should reside in ` test/spec ` in their appropriate folders:
165+ Tests should reside alongside the modules they are testing:
171166
172167```
173- ├── test
174- │ ├── spec
175- │ │ ├── api
176- │ │ │ ├── todos.test.js
168+ ├── server
169+ │ ├── api
170+ │ │ ├── todos
171+ │ │ │ ├── todos.controller.js
172+ │ │ │ ├── todos.controller.test.js
177173```
178174
179175Tests can be written with ES2015, since it passes through ` babel-register ` .
@@ -184,21 +180,19 @@ To run a single test:
184180
185181```
186182npm test /path/to/single.test.js
187- ```
188183
189- To run a directory of tests:
190-
191- ```
192- npm test /path/to/test/directory
184+ // Or, to watch for changes
185+ npm run test:watch /path/to/single.test.js
193186```
194187
195188To run all tests:
196189
197190```
198191npm run test:all
199- ```
200192
201- This will run all tests in the ` test/spec ` directory.
193+ // Or, to watch for changes
194+ npm run test:all:watch
195+ ```
202196
203197## Running ESLint
204198
You can’t perform that action at this time.
0 commit comments