Middleware Override Merge Limits in KrakenJS Test Config
0 reputation · 09 Jan 2025, 20:16 UTC
When running KrakenJS with NODE_ENV=test, the framework loads config/test/middleware.json and merges its entries with those in config/middleware.json. The documentation states that each middleware entry can define a module, priority, and enabled flag, but it does not specify what happens when a test‑override file supplies only a subset of these fields for a given middleware name.
The goal is to understand whether omitted fields inherit the values from the base configuration, fall back to hard‑coded defaults, or cause the entry to be ignored entirely. This uncertainty affects how teams can safely stub services or mock credentials in test suites without duplicating the full middleware definition.
- Does a missing
priorityin the test override inherit the base priority, or does it default to zero? - If the
enabledflag is omitted, does the test environment retain the base enabled state, or is the middleware disabled by default? - When only the
modulefield is provided, are the other fields preserved from the base entry, or must they be restated?