summaryrefslogtreecommitdiff
path: root/doc/guides
diff options
context:
space:
mode:
authorjuggernaut451 <singhjug1994@gmail.com>2018-02-16 00:01:52 +0530
committerTrivikram <16024985+trivikr@users.noreply.github.com>2018-03-24 20:57:03 -0700
commit59b5d77b920aac08aab79df3e2d1969ba804b745 (patch)
treefba5263c6dcdea715a2df091a96bbea10489cb67 /doc/guides
parent1d8909b9b9da37d466d6dada81e8622a492ad5c1 (diff)
downloadandroid-node-v8-59b5d77b920aac08aab79df3e2d1969ba804b745.tar.gz
android-node-v8-59b5d77b920aac08aab79df3e2d1969ba804b745.tar.bz2
android-node-v8-59b5d77b920aac08aab79df3e2d1969ba804b745.zip
doc: add directory structure in writing-tests.md
PR-URL: https://github.com/nodejs/node/pull/18802 Fixes: https://github.com/nodejs/node/issues/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>
Diffstat (limited to 'doc/guides')
-rw-r--r--doc/guides/writing-tests.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md
index 4dbc8163d1..54123362d6 100644
--- a/doc/guides/writing-tests.md
+++ b/doc/guides/writing-tests.md
@@ -18,6 +18,13 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.
+## Test directory structure
+
+See [directory structure overview][] for outline of existing test & locations.
+When deciding on whether to expand an existing test file or create a new one,
+consider going through the files related to the subsystem.
+For example, look for `test-streams` when writing a test for `lib/streams.js`.
+
## Test structure
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.
[all maintained branches]: https://github.com/nodejs/lts
[node.green]: http://node.green/
[test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests
+[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories