CodeVetter · Repo Unpack · Behavior traces
jasmine/jasmine
The inspected flows cover Node initialization/reset, browser startup/reruns, spec execution/assertions, and distribution creation. Their order is visible in the source, including branching for focus, exclusions, callback versus promise execution, and suite failures. These are static traces rather than observed execution results.
- Node startup: the package entrypoint requires jasmine.js -> bootJasmine calls core -> jasmine.getEnv creates/caches Env -> interface binds API closures -> module exports globals; installGlobals explicitly copies them to a destination.
- Node reset: reset clears private$.currentEnv_ -> creates an environment with suppressed load errors -> rebindEnv updates the existing API closures; the reset fixture checks new environment identity and declaration routing.
- Browser startup: boot gets Env -> HtmlReporterV2Urls parses current settings -> env.configure applies them -> wrapped window.onload invokes the previous handler -> constructs/adds the HTML reporter -> env.execute starts execution.
- Declaration and selection: describe immediately invokes its definition callback under a new declaration suite -> it attaches Spec children -> Env.execute installs error handling -> Runner builds the selected/ordered execution tree and awaits jasmineStarted.
- Spec execution: TreeRunner sets the current spec and initializes resources -> awaits specStarted -> runs inherited befores, the spec, and afters -> executionFinished sets duration/status -> resources are cleared -> specDone is awaited; pending/excluded specs omit user functions.
- Async assertion: expectAsync creates a runnable-bound AsyncExpectation -> wrapAsyncCompare captures a stack and awaits comparison -> Expector.processResult records the result; if another runnable is current, Env additionally records a late-expectation failure on the top suite.
- Failure completion: suite execution uses stop-on-first-error or beforeAll-error skipping -> beforeAll failures generate descendant result events -> Runner reports failed, incomplete for focus/no specs, or passed -> awaits jasmineDone -> Env removes global handlers.
- Standalone artifact flow: buildStandaloneDist creates an OS temporary directory -> buildDistribution writes lib outputs -> EJS renders SpecRunner.html -> ZipArchive adds selected assets/examples -> close resolves completion -> finally removes the temporary directory.