Skip to content

fix: resolve 4 pre-existing test failures - #142

Open
jexp wants to merge 1 commit into
mainfrom
fix/failing-tests
Open

fix: resolve 4 pre-existing test failures#142
jexp wants to merge 1 commit into
mainfrom
fix/failing-tests

Conversation

@jexp

@jexp jexp commented May 20, 2026

Copy link
Copy Markdown
Contributor

Two unrelated pre-existing failures, both introduced when the TS port was created in #130.

circleWordWrap.test.jssplitIntoLines is not a function

The test imports splitIntoLines from circleWordWrap.js, but the TS port (and the original arrows-app) only ever exported fitTextToCircle. The function was never added.

Fix: export splitIntoLines from both arrows-ts and arrows-app. The implementation is a simple word-wrap helper (measure each word individually; start a new line when a word exceeds lineWidth; never leave a line empty) consistent with what the test documents.

app.spec.tsx — Nx boilerplate, never applicable

Generated by Nx scaffold, it renders <App> without a Redux Provider and asserts "Welcome arrows-ts" text that has never existed in the real app. Deleted.

Result

Test Files  15 passed (15)   ← was 2 failed | 14 passed
      Tests  72 passed (72)   ← was 4 failed | 70 passed

- Export splitIntoLines from circleWordWrap.js (arrows-ts + arrows-app):
  the TS port only exported fitTextToCircle, leaving the test importing a
  non-existent function. Added the simple word-wrap helper the tests document.

- Delete apps/arrows-ts/src/app/app.spec.tsx: Nx-generated boilerplate that
  renders <App> without a Redux Provider and asserts 'Welcome arrows-ts'
  text that never existed in the real app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant