Skip to content
8 changes: 8 additions & 0 deletions doc/guides/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 viewing tests for `test-streams` when writing a test for `lib/streams.js`.
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fail in the linter as it is above 80 characters.


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this consistent with the other places in the doc and only use a single new line :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this does not seem to be addressed?

## Test structure

Let's analyze this basic test from the Node.js test suite:
Expand Down Expand Up @@ -381,3 +388,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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to change this to:

https://github.com/nodejs/node/blob/master/test/README.md#test-directories

so it links directly to the correct section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made :)