Repository navigation
Commit cba4fe0
committed
test(file-safety): pin the caught error as the cause of the staging-path refusal
safeWriteText.ts:432-434 catches the target lstat failure, compares only its error code and throws
StagingPathError with the caught error as its cause. Nothing asserted that cause: the previous
mutation run priced four survivors on the line that forwards it, and deleting the { cause }
argument left all 135 tests green. This adds the case at the layer that already mocks fs - the
DACL-notices spec that drives the same publish - so the refusal cannot lose its cause again
without a red test.
The case stages a caller-supplied staging file whose target lstat answers EACCES and asserts that
the error the catch received arrives as the refusal's cause. Discriminated rather than merely
added: with 'super(message, cause === undefined ? undefined : {})' the run prints 'Tests 1 failed
| 135 passed (136)' on this case at safeWriteText.daclNotices.spec.ts:243, expecting the EACCES
error and receiving undefined; with the third argument removed at the throw site the same single
test fails with the same message. With the source as committed the pair prints 'Tests 136 passed
(136)'.
The lint leg ran from the package directory with suppressions pruned and added no entry for this
file; the rewrite that pruning did to src/eslint-suppressions.json was reverted rather than
committed. Gates, the two removal runs and the mutation re-run on the priced lines are in
.tmp-cr-audit/pr-sweep-r101.txt section 285.1 parent 251b149 commit cba4fe0
1 file changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
222 | 247 | | |
223 | 248 | | |
224 | 249 | | |
| |||
0 commit comments