How jasmine/jasmine-npm works
Jasmine is a Node.js CLI and programmatic runner for executing Jasmine specs. The main flow is a user invoking the CLI, which selects a runner, loads project configuration and test modules, then reports results. The package also supports spec filtering, global setup and teardown, ES module and CommonJS loading, and parallel execution with worker processes. The README documents initialization and example seeding; their implementations are in the CLI module. Some parallel-worker wiring is only partially shown, so that relationship is marked unverified.
Main entry points: jasmine.js Jasmine runner · runner_base.js Runner base · command.js CLI commands · parallel_runner.js Parallel runner
Components 17
CLI and API
- CLI commands
lib/command.js - CLI entry point
bin/jasmine.js - Jasmine runner
lib/jasmine.js
Test execution
- Runner base
lib/runner_base.js - Global setup and teardown
lib/global_setup_or_teardown_runner.js - Suite path filter
lib/filters/path_spec_filter.js - Name regex filter
lib/filters/regex_spec_filter.js - Exit handling
lib/exit_handler.js
Configuration and loading
- Module loader
lib/loader.js - Path normalization
lib/unWindows.js
Parallel execution
- Parallel runner
lib/parallel_runner.js - Test randomization
lib/randomize.js - Worker entry point
bin/worker.js - Parallel worker
lib/parallel_worker.js
Other components
- Project user
- Project test modules
- Terminal results
Connections 19
- Project user → CLI entry point: invokes
README.md - CLI entry point → CLI commands: starts
bin/jasmine.js - CLI commands → Jasmine runner: selects runner
lib/command.js - CLI commands → Parallel runner: selects runner
lib/command.js - Jasmine runner → Runner base: inherits
lib/jasmine.js - Parallel runner → Runner base: inherits
lib/parallel_runner.js - Runner base → Module loader: loads configuration
lib/runner_base.js - Jasmine runner → Module loader: loads test files
lib/jasmine.js - Jasmine runner → Suite path filter: filters suites
lib/jasmine.js - Jasmine runner → Name regex filter: filters names
lib/jasmine.js - Jasmine runner → Exit handling: guards execution
lib/jasmine.js - Runner base → Path normalization: normalizes paths
lib/runner_base.js - Runner base → Global setup and teardown: runs hooks
lib/runner_base.js - Jasmine runner → Project test modules: executes specs
lib/jasmine.js - Parallel runner → Test randomization: uses randomization
lib/parallel_runner.js - Worker entry point → Parallel worker: starts worker
bin/worker.js - Parallel runner → Worker entry point: dispatches work
- Parallel worker → Name regex filter: filters names
lib/parallel_worker.js - CLI commands → Terminal results: prints results