Capability first · transport second

BrowserTestSuite.js

Runs a complete sequential browser test list with explicit cancellation and full-detail lifecycle events.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Runs a complete sequential browser test list with explicit cancellation and full-detail lifecycle events.

  • Artifact
    BrowserTestSuite.js · esm
  • Classification
    public first party
  • Availability
    Browser / standard Web APIs
  • Normalization
    Complete mutable descriptors, results, lifecycle events, and context; malformed result and skip/assertion errors remain normalized.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/BrowserTestSuite.js';

Runs the complete parent-supplied test list sequentially, creates a per-test AbortController boundary, and emits suite and test lifecycle events without evaluating source text, starting timers, or persisting results.

Application-facing behavior: Event/error/reason constants; default BrowserTestSuite; list(), run(), and dispose(); state-free EventTarget/on compatibility for suite/test lifecycle occurrences.

Protocol and host implementation

Explicit AbortSignal cancellation + per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
BROWSER_TEST_SUITE_EVENT_TYPESvariable · valuevariable BROWSER_TEST_SUITE_EVENT_TYPES
BROWSER_TEST_SUITE_ERROR_CODESvariable · valuevariable BROWSER_TEST_SUITE_ERROR_CODES
BROWSER_TEST_SUITE_REASONSvariable · valuevariable BROWSER_TEST_SUITE_REASONS
defaultdefault · classclass BrowserTestSuite extends EventTarget
assertionErrorfunctionfunction assertionError(message)message
skipErrorfunctionfunction skipError(message)message
CallableKindExact public signatureParameter syntax
BrowserTestSuite.listpublic-memberlist()
BrowserTestSuite.runpublic-memberasync run(options={})options={}
MemberKindExact public declarationParameter syntax
BrowserTestSuite.constructorconstructorconstructor(options={})options={}
BrowserTestSuite.addEventListenermethodaddEventListener(type,listener,options)type,listener,options
BrowserTestSuite.removeEventListenermethodremoveEventListener(type,listener,options)type,listener,options
BrowserTestSuite.onmethodon(type,listener,options)type,listener,options
BrowserTestSuite.dispatchEventmethoddispatchEvent(value)value
BrowserTestSuite.runninggetget running()
BrowserTestSuite.listmethodlist()
BrowserTestSuite.runasync methodasync run(options={})options={}
BrowserTestSuite.disposemethoddispose()
BrowserTestSuite.destroymethoddestroy()

Parameter meanings and results

BrowserTestSuite({tests, now, ...metadata}).list() returns complete mutable descriptors. Caller metadata does not limit or time the supplied list. run({context, signal}) returns a complete mutable {status, totals, durationMs, results} summary and supplies assert, skip, signal, and context to each callback.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • browser-test-suite-start
  • browser-test-start
  • browser-test-result
  • browser-test-suite-complete

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • BROWSER_TEST_BUSY
  • BROWSER_TEST_ABORTED
  • BROWSER_TEST_TIMEOUT
  • BROWSER_TEST_SKIP
  • BROWSER_TEST_ASSERTION
  • BROWSER_TEST_ERROR
  • BROWSER_TEST_INVALID_OPTIONS
  • BROWSER_TEST_INVALID_DESCRIPTOR
  • BROWSER_TEST_INVALID_CLOCK
  • BROWSER_TEST_INVALID_RESULT
  • BROWSER_TEST_CASE_COLLISION

Availability and capabilities

Browser / standard Web APIs. Complete mutable descriptors, results, lifecycle events, and context; malformed result and skip/assertion errors remain normalized.

First-party browser behavioral-test runner with no Core dependency and no arbitrary-code text interface.

Contract example

JavaScript
import BrowserTestSuite from '/arcane/modules/BrowserTestSuite.js';

const suite=new BrowserTestSuite({
    tests:[{
        id:'dom-ready',
        name:'Document is ready',
        run({assert}){
            assert(document.readyState!=='loading','Wait for DOMContentLoaded.');
        }
    }]
});
console.log(await suite.run());

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.