Commit add6df6
committed
fix: restore env vars in finally block to prevent test pollution
Move environment variable restoration from the try block to a finally
block so env vars passed via the test harness are always cleaned up,
even when the command fails and Deno's exit sanitizer intercepts the
Deno.exit() call.
Without this, a test that sets env vars (e.g. QUARTO_PDF_STANDARD)
via TestContext.env could leak those values to subsequent tests when
running in the same deno test process.1 parent c68905f commit add6df6
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 199 | | |
207 | 200 | | |
208 | 201 | | |
| |||
213 | 206 | | |
214 | 207 | | |
215 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
0 commit comments