Commit 187c61c
committed
fix(sync-regression): restore code-point-safe truncate + ignore node:test suites
Two regressions from the 2026-04-26 agent-core sync (PR #350):
1. lib/cross-platform/index.js::truncate lost its code-point-safe
slicing (splitting surrogate pairs on emoji) and its non-positive
maxLength special case. Restored [...text] spread + maxLength <= 0
early return. Regression tests in __tests__/cross-platform.test.js
now pass.
2. jest.config.js testMatch picked up lib/binary/index.test.js which is
a node:test suite (agent-core convention for co-located tests), and
Jest failed with "must contain at least one test". Added
/lib/binary/.*\.test\.js$ to testPathIgnorePatterns; run it via
`node --test lib/binary/*.test.js` instead.
Both fixes should be upstreamed to agent-core so every consumer gets
them uniformly on next sync.1 parent e12f90a commit 187c61c
2 files changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
307 | 311 | | |
308 | 312 | | |
309 | | - | |
| 313 | + | |
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
313 | | - | |
314 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
| |||
0 commit comments