CodeVetter · Repo Unpack · Data flow
jasmine/jasmine
Spec definitions become an in-memory suite tree, then configuration transforms that tree into an execution plan. Expectations and exceptions update runnable-owned execution state, which is converted into reporter events. Browser result state feeds DOM views, while rerun settings cross reloads through URL parameters.
- Global declaration functions delegate to Env, which rejects declarations during execution, derives the caller filename, and returns metadata from SuiteBuilder-created suites/specs.
- SuiteBuilder tracks the current declaration suite and sequential IDs; specFactory_ captures hooks, configuration flags, path generation, timeout, and cloned suite user context into each Spec.
- Runner chooses explicit runnable IDs, focused IDs, or the top suite, then supplies seeded child ordering and specFilter(metadata) exclusion to TreeProcessor.processTree.
- Runnable resources shallow-copy parent customization tables and arrays into child scope; completion removes the error override, restores spies, and deletes that runnable's resources.
- Env.expect binds actual values and scoped matchers to the current runnable; Expector instantiates the matcher, compares arguments, builds a message, and calls Spec.addExpectationResult.
- Spec stores passed/failed expectations, duration, reasons, properties, and debug logs; doneEvent exposes these fields, and ReportDispatcher structured-clones each event separately for each reporter.
- ResultsStateBuilder builds a parent-linked result tree and counters from suite/spec events; HtmlReporterV2 renders summary and performance views at jasmineDone, and failure strings become text nodes.
- Rerun links serialize suite/spec paths into the path query parameter; QueryString URI-encodes parameters, and the next boot reconstructs configuration and prefix-path or substring filtering from window.location.