Skip to content

Add an automated test suite + CI pipeline #1464

Description

@MBuelowius

Summary

PptxGenJS is widely used in production, but the repo currently has no automated test suite or CI — testing is manual per TESTING.md (render the demos and eyeball the output). This makes regressions in the XML-generation paths easy to miss.

Proposal

A lightweight, low-dependency setup:

  • Runner: Node's built-in node:test + tsx (run the TS sources directly — no Jest/Vitest, no extra config).
  • Unit tests for the pure helpers in src/gen-utils.ts (EMU/point conversions, color + XML-escaping helpers, shadow-option normalization).
  • End-to-end test that builds a deck (text + shape + table + chart), writes it to a buffer, and asserts the resulting .pptx is a valid OOXML package: required parts present, every XML part well-formed, expected content present. This exercises gen-xml / gen-objects / gen-tables / gen-charts together.
  • CI (GitHub Actions): lint + typecheck + test + build on Node 20 & 22.
  • Optional extras: a prepublishOnly gate, Dependabot, CodeQL.

package.json would gain lint / typecheck / test scripts (eslint is already configured, just not wired to a script).

Offer

I've prototyped all of the above (18 passing tests, including the OOXML validation) in a fork. Happy to open a PR if this is welcome — glad to adjust the runner or scope to your preference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions