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 14:22] – better indentation fantasai | test:scripttest [2012/12/11 18:19] – [Per-Test Metadata] plinss | ||
---|---|---|---|
Line 24: | Line 24: | ||
<code html> | <code html> | ||
- | <script src="/ | + | < |
- | <script src="/ | + | < |
</ | </ | ||
* Each test can have one or more asserts. Note: some prefer a test is limited to a single assert but that is not mandatory. | * Each test can have one or more asserts. Note: some prefer a test is limited to a single assert but that is not mandatory. | ||
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 51: | Line 56: | ||
{ help: ' | { help: ' | ||
| | ||
- | | + | |
); | ); | ||
</ | </ | ||
- | These values would override any metadata set in the < | + | Each value can be either a single string, or an array of strings if multiple values need to be specified. |
+ | |||
+ | If there is only a single script test in a file, all metadata should be in the < | ||
+ | |||
+ | === Metadata Cache === | ||
+ | |||
+ | The metadata cache exposes the names of the script tests and all associated per-test metadata to our testing tool suite. Using this data we can track the testing coverage of each specification as well as generate testing statistics and reports. If there are multiple script tests in a file, the metadata cache must be present, even if there is no test-specific metadata present (to list the names of each script test). | ||
+ | |||
+ | The version of testharnessreport.js on http:// | ||
- | If there is only a single | + | To access this functionality, |