Package io.karatelabs.core
Class BootLoader
java.lang.Object
io.karatelabs.core.BootLoader
Discovers
karate-boot.js (workdir root, then classpath root) and evaluates
it once per Suite. The boot file is ext-scripting only — its JS scope is
discarded after evaluation; the side effects (exts registered on Suite) are the
only output. See AGENT_KARATE.md K43.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BootBindingBoot-only evaluation: runkarate-boot.jsfor a project working dir and return theBootBindingwithout running any features (noSUITE_ENTER/SUITE_EXIT, no scenarios).static BootBindingloadIfPresent(Suite suite, String env) Discover + evaluatekarate-boot.jsfor the given Suite.
-
Field Details
-
BOOT_FILE_NAME
- See Also:
-
-
Method Details
-
loadIfPresent
Discover + evaluatekarate-boot.jsfor the given Suite. Returns theBootBindingso the caller can surface registered exts onSUITE_ENTER. Returnsnullwhen no boot file is present (the common case — boot is opt-in).- Throws:
RuntimeException- when boot is present but evaluation fails (Suite must fail loud per K43).
-
bootOnly
Boot-only evaluation: runkarate-boot.jsfor a project working dir and return theBootBindingwithout running any features (noSUITE_ENTER/SUITE_EXIT, no scenarios). The boot side effects — exts constructed + configured viaboot.ext(name)+.putMember(...)during the JS eval — are the whole point, so a caller that lives outside a run (e.g. a persistent serve engine re-deriving a project's per-runcov.*config) can reach the booted, configured exts on demand.Constructs the minimal
Suitethe boot phase needs (this package owns the package-private Suite construction, so callers don't have to) anchored atworkingDirfor both config + boot discovery, then delegates toloadIfPresent(io.karatelabs.core.Suite, java.lang.String). ReturnsnullwhenworkingDiris null or nokarate-boot.jsis present (the no-ext zero-cost path is preserved).- Throws:
RuntimeException- when a boot file IS present but its evaluation fails (fail-loud per K43).
-