LearnNewsExamplesServices
Frontmatter
id15118
titleAdd unit coverage for Neo.util.String
stateClosed
labels
enhancementhelp wantedgood first issuecontributor-experienceaitesting
assigneesBortlesboat
createdAt2:10 AM
updatedAt3:20 AM
githubUrlhttps://github.com/neomjs/neo/issues/15118
authorneo-gpt-emmy
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAt3:20 AM

Add unit coverage for Neo.util.String

Closed Backlog/active-chunk-5 enhancementhelp wantedgood first issuecontributor-experienceaitesting
neo-gpt-emmy
neo-gpt-emmy commented on 2:10 AM

Context

GitHub surfaces approachable repository work through the good first issue label. Neo currently has no open issue carrying that label, so this ticket creates a deliberately small, self-contained entry point outside the v13.2 release work.

[!IMPORTANT] Reserved for first-time Neo.mjs contributors. The Neo maintainer team will not claim, edit, or implement this ticket through 2026-07-20. A first-time contributor may claim it immediately; contributor questions and PR reviews remain welcome during the reservation window.

Problem

Neo.util.String contains small, deterministic helpers for entity mapping, escaping, unescaping, and first-letter normalization, but it has no focused unit spec. The missing coverage was already identified as a standalone follow-up in #7441.

Architectural reality

  • Runtime source: src/util/String.mjs
  • Canonical test destination: test/playwright/unit/util/String.spec.mjs
  • Established sibling pattern: test/playwright/unit/util/Env.spec.mjs and Rectangle.spec.mjs
  • This is test-only work; no new runtime abstraction or directory is needed.

Contract ledger

Surface Current contract to cover
escapeHtml() Replaces characters selected by the existing charPattern with their configured entities
unescapeHtml() Replaces each supported entity with its configured character
Mapping helpers Known mappings resolve; unknown characters/entities pass through unchanged
Non-string input escapeHtml() and unescapeHtml() return it unchanged
uncapitalize() Lowercases the first character while preserving the remainder and handles empty/falsy input

Acceptance criteria

  • Add test/playwright/unit/util/String.spec.mjs using the existing util-spec setup/import pattern.
  • Cover every character currently selected by StringUtil.charPattern.
  • Cover every entity currently selected by StringUtil.entityPattern.
  • Cover getEntityFromChar() and getCharFromEntity() for known and unknown values.
  • Cover non-string pass-through for escapeHtml() and unescapeHtml().
  • Cover uncapitalize() for an uppercase-leading string, an already-lowercase string, and empty/falsy input.
  • Keep the change test-only. If a documented contract and runtime behavior disagree, stop and ask on this ticket before changing src/util/String.mjs.
  • Run the focused spec: npm run test-unit -- test/playwright/unit/util/String.spec.mjs
  • Run the complete unit suite: npm run test-unit

Out of scope

  • Refactoring Neo.util.String
  • Widening charPattern or changing current escaping semantics
  • Any v13.2 release, Agent OS, Fleet Manager, docking, or Golden Path work
  • Broad utility-suite cleanup

Avoided traps

  • Do not infer that every key in charEntityMap must be selected by charPattern; this ticket covers the current public behavior rather than redesigning it.
  • Do not run default npx playwright test; Neo requires its custom unit configuration.
  • Import src/Neo.mjs and src/core/_export.mjs as the sibling specs do.
  • Do not change runtime behavior merely to make a test easier.

Prior art and duplicate sweep

  • #7441 explicitly identified Neo.util.String coverage as a separate unit-test ticket.
  • Final live sweep on 2026-07-13 checked the latest 20 open issues, exact repository issue history, Knowledge Base results, local repository references, and the recent A2A ledger; no equivalent open ticket or active lane was found.
  • Memory Core semantic mining was degraded by an embedding-canary timeout, so the live GitHub, Knowledge Base, source, and A2A evidence above is the controlling duplicate check.

Decision-record impact

None. This ticket pins existing public utility contracts and introduces no architectural decision.

Origin Session ID: f95e01ff-ba36-409a-98af-573263fab247

Bortlesboat
Bortlesboat 2:29 AM

I'd like to take this as a first-time Neo.mjs contributor. I’ll keep the change test-only, follow the existing util-spec import/setup pattern, cover every contract in the issue ledger, and run both the focused spec and complete unit suite before opening a PR against dev. I’m using OpenAI Codex for implementation support and will review and verify the resulting diff.

  • 2026-07-13T00:40:54Z @neo-gpt-emmy assigned to @Bortlesboat

@neo-gpt-emmy - 2026-07-13T00:40:55Z

Welcome, @Bortlesboat — assigned. Your proposed scope matches the ticket well.

I strongly recommend starting with Neo's unit-test agent skill and following its linked workflow before writing the spec. It captures Neo's non-standard Playwright unit-test architecture, required Neo.mjs + core/_export.mjs imports, shared-worker namespace cautions, and the exact focused/full-suite commands. The companion Unit Testing guide provides the underlying single-thread simulation model.

For this ticket, the focused verification is:

npm run test-unit -- test/playwright/unit/util/String.spec.mjs

Then run npm run test-unit before opening the PR against dev. Please do not use the default unconfigured npx playwright test command. If current behavior and the ticket contract appear to disagree, ask here before changing src/util/String.mjs; this lane is intentionally test-only.

Glad to have you contributing to Neo.

Bortlesboat cross-referenced by PR #15119 on 2:51 AM
tobiu referenced in commit 783b823 - "test(util): cover String helpers (#15118) (#15119)" on 3:20 AM
tobiu closed this issue on 3:20 AM