Skip to content

Commit 43f24c0

Browse files
juggernaut451targos
authored andcommitted
doc: add directory structure in writing-tests.md
PR-URL: #18802 Fixes: #18774 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 157fc28 commit 43f24c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/guides/writing-tests.md

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ Add tests when:
1818
- Fixing regressions and bugs.
1919
- Expanding test coverage.
2020

21+
## Test directory structure
22+
23+
See [directory structure overview][] for outline of existing test & locations.
24+
When deciding on whether to expand an existing test file or create a new one,
25+
consider going through the files related to the subsystem.
26+
For example, look for `test-streams` when writing a test for `lib/streams.js`.
27+
2128
## Test structure
2229

2330
Let's analyze this basic test from the Node.js test suite:
@@ -380,3 +387,4 @@ will depend on what is being tested if this is required or not.
380387
[all maintained branches]: https://github.com/nodejs/lts
381388
[node.green]: http://node.green/
382389
[test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests
390+
[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories

0 commit comments

Comments
 (0)