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
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
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
BROWSER_TEST_SUITE_EVENT_TYPES | variable · value | variable BROWSER_TEST_SUITE_EVENT_TYPES | — |
BROWSER_TEST_SUITE_ERROR_CODES | variable · value | variable BROWSER_TEST_SUITE_ERROR_CODES | — |
BROWSER_TEST_SUITE_REASONS | variable · value | variable BROWSER_TEST_SUITE_REASONS | — |
default | default · class | class BrowserTestSuite extends EventTarget | — |
assertionError | function | function assertionError(message) | message |
skipError | function | function skipError(message) | message |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
BrowserTestSuite.list | public-member | list() | — |
BrowserTestSuite.run | public-member | async run(options={}) | options={} |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
BrowserTestSuite.constructor | constructor | constructor(options={}) | options={} |
BrowserTestSuite.addEventListener | method | addEventListener(type,listener,options) | type,listener,options |
BrowserTestSuite.removeEventListener | method | removeEventListener(type,listener,options) | type,listener,options |
BrowserTestSuite.on | method | on(type,listener,options) | type,listener,options |
BrowserTestSuite.dispatchEvent | method | dispatchEvent(value) | value |
BrowserTestSuite.running | get | get running() | — |
BrowserTestSuite.list | method | list() | — |
BrowserTestSuite.run | async method | async run(options={}) | options={} |
BrowserTestSuite.dispose | method | dispose() | — |
BrowserTestSuite.destroy | method | destroy() | — |
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
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());
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.