Skip to content

Commit 13e7944

Browse files
committed
test/scripttest: created
1 parent c35bc8b commit 13e7944

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

test/scripttest.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
====== Script Tests ======
2+
3+
A //script test// is a test that uses JavaScript to programmatically verify one or more specific functionalities. Unlike [[test:selftest|self-describing tests]] and [[test:reftest|reftests]], script tests do not verify rendering.
4+
5+
Script tests should be used to verify functionalities that do not require rendering, for example, a JavaScript API. Script tests can also be used to add automation to [[test:reftest|reftests]] for clients that do not support [[test:reftest|reftests]].
6+
7+
==== Components of a Script Test ====
8+
9+
A script test can be written as a single file with a script block that contains the JavaScript, or the JavaScript can be contained in a separate .js file that is imported by the test file.
10+
11+
==== Test Harness ====
12+
13+
The test harness (written and maintained by James Graham) is a JavaScript file that facilitates writing test cases. Specifically, test harness offers test authors:
14+
* A convenient API for making common test assertions
15+
* Support for testing synchronous and asynchronous DOM features in a way that promotes clear, robust, tests
16+
17+
Script tests written for the CSSWG //should// use test harness whenever possible.
18+
19+
20+
21+
22+
23+
24+
==== Per-Test Metadata ====

0 commit comments

Comments
 (0)