Skip to content

fix: Test suite ESM/TextDecoder compatibility issue blocking all PRs #646

@ashleyshaw

Description

@ashleyshaw

file_type: "issue"
issue_type: "bug"
area: "tests"
priority: "critical"
component: "ci"
status: "needs-triage"

Build/CI Summary

Jest test suite fails with TextDecoder is not defined errors when running tests with ESM modules. This is a pre-existing infrastructure issue blocking all PRs regardless of code quality.

Problem Statement

The test runner does not properly polyfill TextDecoder in ESM mode, causing fixture validation and other tests to fail before checking code quality.

Impact:

  • All PRs blocked from merging
  • CI/CD pipeline non-functional
  • Prevents validation of any code changes

Example Error:

ReferenceError: TextDecoder is not defined
  at Module.<anonymous> (node_modules/@actions/core/...)

Steps / Checklist

  • Investigate Jest ESM configuration
  • Test different polyfill approaches
  • Verify @actions/core compatibility with ESM
  • Configure Jest to polyfill TextDecoder in ESM mode
  • Run full test suite to verify fix
  • Test on multiple Node versions (18+, 20+)
  • Update CI configuration if needed
  • Document solution in troubleshooting guide

Acceptance Criteria

  • Test suite runs without TextDecoder errors
  • All existing tests pass without modification
  • No changes needed to individual test files
  • PR testing works for all code changes
  • CI workflow completes successfully
  • Documentation updated if configuration changed

Additional Context

Affected Workflows:

  • Testing workflow (blocks all PRs)
  • All dependent CI checks

Related Issues:

Environment:

  • Node.js: 20+ (see .nvmrc)
  • Package Manager: npm 10+
  • Jest Version: (check package.json)
  • @actions/core Version: (check package.json)

References


Definition of Ready (DoR)

  • Build/CI goal and scope defined
  • Checklist prepared
  • Estimate added

Definition of Done (DoD)

  • All checklist and acceptance criteria completed
  • Documentation/changelog updated
  • Approved by maintainer
  • CI workflow stable after fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions