This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
test:scripttest [2012/06/14 13:52] – [Per-Test Metadata] jacobg | test:scripttest [2012/06/20 16:32] – [Writing tests] jacobg | ||
---|---|---|---|
Line 32: | Line 32: | ||
* A test fails at the first failing assert, and the remainder of the test is (typically) not run. | * A test fails at the first failing assert, and the remainder of the test is (typically) not run. | ||
* If the file containing the tests is a HTML file with an element of id " | * If the file containing the tests is a HTML file with an element of id " | ||
+ | |||
+ | ===== Writing tests ===== | ||
+ | |||
+ | The full API of testharness.js is documented within the [[http:// | ||
+ | |||
==== Bug Reporting ==== | ==== Bug Reporting ==== | ||
Line 38: | Line 43: | ||
==== Per-Test Metadata ==== | ==== Per-Test Metadata ==== | ||
- | Additionally, | + | Test-specific metadata can be passed in the properties |
* help - The url for the part of the specification being tested | * help - The url for the part of the specification being tested | ||
Line 47: | Line 52: | ||
<code html> | <code html> | ||
- | test(function() { assert_true(true); | + | test(function() { assert_true(true); |
- | | + | ' |
- | | + | |
- | | + | |
+ | | ||
+ | ); | ||
</ | </ | ||
Line 56: | Line 63: | ||
If there is only a single script test in a file, all metadata should be in the < | If there is only a single script test in a file, all metadata should be in the < | ||
+ | |||
+ | === Metadata Cache === | ||
+ | |||
+ | The default version of testharnessreport.js now contains code that reads your per-test metadata and compares it to the cached version. If the cache is not present, or is out of sync, it'll display a message to that effect and generate a link which, when clicked, will generate the appropriate source code for the cached metadata suitable for copy/paste into the test's < | ||
+ | |||
+ | To access this functionality, |