Skip to content

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

@ashleyshaw

Description

@ashleyshaw

Problem

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

Root Cause

Jest ESM compatibility issue with @actions/core and other Node.js built-ins. The test runner doesn't properly polyfill TextDecoder in ESM mode.

Impact

  • Blocking: All PRs cannot merge due to test suite failures
  • Not code-specific: Failures occur regardless of PR content
  • Reproducible: Consistent failure across multiple CI runs

Example Error

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

Affected Workflows

  • Testing workflow
  • All PRs (blocks CI pass gate)

Solution Options

  1. Configure Jest to polyfill TextDecoder in ESM mode
  2. Add Node.js built-ins polyfill to test setup
  3. Update @actions/core to compatible version
  4. Configure Jest ESM loader with proper globals

Acceptance Criteria

  • Test suite runs without TextDecoder errors
  • All existing tests pass
  • No modifications needed to individual test files
  • PR testing works for all code changes

Labels

  • type:bug
  • area:tests
  • area:infrastructure
  • priority:critical
  • component:ci

Related: PR #634 blocked by this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions