Commit 94c604e
fix(test): harden bundling-disable against ambient CDK_CONTEXT_JSON (#366)
Two robustness fixes to the global bundling-disable setup file, both from
PR #371 review (finding 1 hardening nits):
- Spread BUNDLING_DISABLED_CONTEXT LAST when merging a pre-set
CDK_CONTEXT_JSON, so an ambient `aws:cdk:bundling-stacks` value can no
longer silently win and re-enable bundling. This is safe precisely because
the documented per-test opt-out is `postCliContext` (applied after the env
var regardless), so the escape hatch still works.
- Guard `JSON.parse` of the pre-set var with try/catch. A malformed value
previously threw inside setupFiles and failed every test in every file with
an opaque parse error; now the blame is localized to the offending value.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent ce523fa commit 94c604e
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
54 | 69 | | |
55 | 70 | | |
56 | 71 | | |
| |||
0 commit comments