Skip to content

Expand types-smoke.ts to cover untested type contracts #2

Description

@yrstm

Problem

types-smoke.ts currently exercises only the core extraction and rendering paths. Several type contracts added in 0.3.0 are not exercised, so regressions would pass the types:check script silently.

Missing coverage

  • MantisSection.object — the "section" discriminator added in 0.3.0 is not asserted
  • MantisSelection shape — object, text, note, createdAt, source fields
  • MantisInlineRun union — all five type values ("text", "link", "code", "strong", "em") and the conditional href on link runs
  • MantisBlock.listdepth, ordered, index on list_item blocks
  • MantisBlock.language — optional field on code blocks
  • MantisCitation.hrefs and offset fields
  • MantisLink.rel and source fields
  • MantisImage.title and source fields
  • MantisTable.caption, headers, rows fields
  • MantisFromHTMLOptions — verify DOMParser shape is assignable
  • MantisMarkdownOptions — all option fields (frontmatter, images, tables, maxChars, budget)
  • MantisExtractOptions — all option fields

Suggested fix

Add typed variable assignments in types-smoke.ts that exercise each interface field, mirroring the pattern already used for MantisArticle. TypeScript's structural checking will catch missing or mistyped fields at compile time without needing a runtime test.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions