Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/contributing/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ so that when it fails, other contributors can fix it with the full context
of its intention, and be able to modify it in good confidence when the context
changes.

A good test should avoid using flags such as `--expose-internals` to access internals
Comment thread
joyeecheung marked this conversation as resolved.
Resolved
that are not part of the public API unless there's a strong justification for doing so.
If it's absolutely necessary to use internals, try to make the test flexible enough to
not test more than what it really tries to verify, so that when irrelevant changes
are made to the internals, the test still passes. Avoid V8 flags meant for testing V8
itself, such as `--allow-natives-syntax`. Tests that rely on them depend on V8 internal
behavior, such as when a function gets optimized or how a string is represented internally,
which can change in any V8 upgrade and is outside of our control.

## Test structure

Let's analyze this basic test from the Node.js test suite:
Expand Down
Loading