mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
9b4bf7de6c
PR-URL: https://github.com/nodejs/node/pull/23423 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
820 B
820 B
JavaScript tests with expected output
Tests in test/message
pass if the output matches the expected output.
Message tests are particularly useful when checking for exact error messages.
Tests and their expected output must have the same filename, with the .js
and
.out
extension.
foo.js
foo.out
All tests must end with an exception. The test runner does not
handle output from multiple runs, e.g., --stress-opt
. Without an exception,
the output will be generated several times and the comparison will fail.
You can use a regex in the expected output instead of the exact path:
*%(basename)s:7: SyntaxError: Detected cycle while resolving name 'a'
Empty lines are ignored in the comparison, but whitespaces are not.
Exact details of the test runner are in testcfg.py.