Bug 1571940 [wpt PR 18304] - [docs] Explain behavior of failing assertions, a=testonly
authorMike Pennisi <mike@mikepennisi.com>
Wed, 14 Aug 2019 10:56:38 +0000
changeset 488114 32daa44117d0be2030a8ac6bae0e6893da18963d
parent 488113 afb522e14cdc327f605c3c465c5e58fbcfd5c977
child 488115 1054904199286a37d07e4cf547e3370d312337b2
push id36435
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:46:49 +0000
treeherdermozilla-central@0db07ff50ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1571940, 18304
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1571940 [wpt PR 18304] - [docs] Explain behavior of failing assertions, a=testonly Automatic update from web-platform-tests [docs] Explain behavior of failing assertions The mechanism that assertions use to signal failure influences test design and is therefore relevant to test authors. -- wpt-commits: 1812d81b14f0d81799370beb04f744d3c113a9ca wpt-pr: 18304
testing/web-platform/tests/docs/writing-tests/testharness-api.md
--- a/testing/web-platform/tests/docs/writing-tests/testharness-api.md
+++ b/testing/web-platform/tests/docs/writing-tests/testharness-api.md
@@ -292,16 +292,21 @@ assert_something(actual, expected, descr
 ```
 
 although not all assertions precisely match this pattern e.g. `assert_true`
 only takes `actual` and `description` as arguments.
 
 The description parameter is used to present more useful error messages when
 a test fails.
 
+When assertions are violated, they throw a runtime exception. This interrupts
+test execution, so subsequent statements are not evaluated. A given test can
+only fail due to one such violation, so if you would like to assert multiple
+behaviors independently, you should use multiple tests.
+
 NOTE: All asserts must be located in a `test()` or a step of an
 `async_test()`, unless the test is a single page test. Asserts outside
 these places won't be detected correctly by the harness and may cause
 unexpected exceptions that will lead to an error in the harness.
 
 ## Cleanup ##
 
 Occasionally tests may create state that will persist beyond the test itself.