CodeVetter · Repo Unpack · Extension points
jasmine/jasmine
Extension primarily happens through public customization APIs and explicit factory registries. Runnable-scoped tables control inheritance and teardown of custom matchers, equality testers, formatters, and spy strategies. Reporters and external runners are separate integration seams with cloning and process-boundary constraints.
- A new built-in matcher must expose a getJasmineRequireObj factory and join the synchronous or asynchronous availableMatchers list, which instantiates registered factories.
- Env.addMatchers/addAsyncMatchers populate current-runnable tables; Expectation and AsyncExpectation install instance methods using those custom factories.
- Custom equality testers join a scoped ordered list; MatchersUtil.eq_ consults asymmetric matchers first, then accepts the first custom tester result that is not undefined.
- Custom object formatters enter RunableResources and are passed into the pretty printer; makeMatchersUtil combines that printer with the current equality testers.
- addSpyStrategy and setDefaultSpyStrategy customize scoped SpyFactory behavior; custom strategy factories must return a function and cannot replace an existing SpyStrategy member.
- Reporters implement any subset of six lifecycle events and register through Env.addReporter; dispatch supports returned promises or done callbacks, isolates event objects by cloning, and supports a fallback reporter.
- Configuration.specFilter is an execution-selection hook, and requireCore deliberately allows new Jasmine namespace properties while locking existing members except four timeout/pretty-print settings.
- External parallel runners can use ParallelReportDispatcher and Env's parallel loading/reset methods; the dispatcher explicitly requires a process separate from running specs, and parallel Env mode restricts configuration, reporters, focus, and seeded/nonrandom execution.