Skip to content
Marcos Caceres edited this page Mar 27, 2026 · 12 revisions

data-tests

Applies to: <p>, <li>, and other elements containing testable assertions

Links one or more WPT test files to a prose assertion. Creates a collapsible "Tests" detail box on the element.

Usage

<script>
  var respecConfig = {
    testSuiteURI: "https://wpt.fyi/payment-request/",
  };
</script>

<p data-tests="payment-request-basics.https.html, timeout.html">
  The user agent MUST reject the Promise if the user cancels.
</p>

Notes

  • Value is a comma-separated list of test file paths, relative to testSuiteURI
  • testSuiteURI must be set in respecConfig — ReSpec will warn if it's missing
  • Enable the wpt-tests-exist linting rule to verify all referenced tests actually exist in WPT
  • Works best on <p> and <li> elements containing normative assertions

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally