Skip to content

Add integration tests for chord-mark public API#669

Merged
no-chris merged 5 commits into
masterfrom
add-integration-public-api-tests
Mar 27, 2026
Merged

Add integration tests for chord-mark public API#669
no-chris merged 5 commits into
masterfrom
add-integration-public-api-tests

Conversation

@no-chris
Copy link
Copy Markdown
Owner

Summary

  • Add 17 integration test files (204 tests) that test parseSong, renderSong, and lineTypes exclusively through the public API (src/chordMark.js)
  • Tests organized by concept: basics, chords, time signatures, sections, keys, error recovery, alignment, transposition, filtering, sub-beats, and options
  • Shared fixtures strategy with helpers for HTML-to-text conversion and song input building
  • No source files modified, 100% coverage maintained

Test plan

  • npx jest --testPathPattern="integration-public-api" --verbose — all 204 tests pass
  • npx jest --coverage — full suite (1507 tests) passes with 100% coverage
  • git diff packages/chord-mark/src/ — no source files modified

🤖 Generated with Claude Code

no-chris and others added 5 commits March 20, 2026 11:49
Test parseSong, renderSong, and lineTypes exclusively through the
public API (src/chordMark.js). 17 test files with 205 tests organized
by concept: basics, chords, time signatures, sections, keys, errors,
alignment, transposition, filtering, sub-beats, and options.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace vague toContain checks with exact toBe assertions using
the full expected output. Fix positioned chords to assert exact
chordPositions array and lyrics content. Verify exact allChords
count, first/last chord identity, and sub-beat group structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Break string literals at \n boundaries so each rendered line
is visually on its own line in the test code, making it easier
to review expected output at a glance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- parseSong-keys: verify originalKey is set on chord lines with
  correct key string and accidental, not just allChords.length > 0
- parseSong-sections: replace > 0 / >= 2 guards with exact counts
  and type verification for isFromSectionCopy (6 lines),
  isFromSectionMultiply (3 lines), isFromAutoRepeatChords (1 line)
- parseSong-chords: verify %% repeats the correct chord line content
  (C.. G..), not just the isFromChordLineRepeater flag
- renderSong-time-signatures: use exact toBe for inline TS default
  test instead of vague toContain('2/4')

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling 07c3079 on add-integration-public-api-tests
into acc576e on master.

@no-chris no-chris merged commit d0959d2 into master Mar 27, 2026
1 check passed
@no-chris no-chris deleted the add-integration-public-api-tests branch March 27, 2026 21:50
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.

2 participants