Commit 2a2f39b
test(plugin-email): assert the over-limit attachment by identity, not deep equality (#16522)
The over-limit test's stated subject is the comment above it -- "delivered
inline and delivered WHOLE". Deep equality is the WEAKER reading of that: it
passes for a copy too, so it cannot tell an untouched buffer from one the
service re-encoded and rebuilt to the same bytes. `toBe` on the captured call
argument proves the exact instance the caller allocated travelled through the
over-limit path untouched, which is what "whole" means.
Removing the O(n) walk over the 256 KiB + 1 fixture is a consequence of that,
not the reason for it. Measured in this container, under the shared verify
lock, `--reporter=verbose`:
target test 674 ms -> 1 ms
its file, tests total 800 ms -> 125 ms (21 siblings total 126 ms)
whole package 2287 ms -> 1537 ms across the same 468 tests
The fixture size is unchanged (the over-limit boundary IS the subject), no
timeout was raised, and nothing was skipped.
The transport fake in this one test now declares its parameter so the captured
call is typed rather than cast -- `vi.fn(async () => ...)` has an empty
parameter tuple, which makes `mock.calls[0][0]` a type error under the
package's test-layer typecheck.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7a5592f commit 2a2f39b
1 file changed
Lines changed: 21 additions & 5 deletions
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
292 | 307 | | |
293 | 308 | | |
294 | | - | |
295 | | - | |
296 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
297 | 313 | | |
298 | 314 | | |
299 | 315 | | |
| |||
0 commit comments