Commit 1ce122a
test(rbac): cover REQUIRE_PLUGINS fail-fast paths in the lazy controller
Four tests in require-plugins.test.ts driving the loader's branching:
- REQUIRE_PLUGINS unset + plugin missing → falls back (resolves false)
- REQUIRE_PLUGINS=1 + plugin missing → rejects on first method call
- forceFallback: true beats REQUIRE_PLUGINS=1 (test escape hatch)
- Any non-"1" value of REQUIRE_PLUGINS is treated as unset
The plugin module isn't installed in this OSS repo, so the dynamic import
naturally fails with ERR_MODULE_NOT_FOUND — no module mocking needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4009d0f commit 1ce122a
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments