data tests - speced/respec GitHub Wiki

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
⚠️ **GitHub.com Fallback** ⚠️