Skip to content

Fix Jest config, test script, and redisService mock for test suite#543

Open
Robinsonchiziterem wants to merge 1 commit into
StellarDevHub:mainfrom
Robinsonchiziterem:fix-test-suite
Open

Fix Jest config, test script, and redisService mock for test suite#543
Robinsonchiziterem wants to merge 1 commit into
StellarDevHub:mainfrom
Robinsonchiziterem:fix-test-suite

Conversation

@Robinsonchiziterem
Copy link
Copy Markdown
Contributor

#501 Pull Request

name: Pull Request
about: Submit changes to Soroban Playground
title: 'Fix Jest configuration and test suite failures'
labels: 'bug'
assignees: ''

What does this PR do?

  • Updated jest.config.cjs to correctly handle ESM modules and added experimental VM options.
  • Modified package.json test script to invoke Jest with required flags.
  • Fixed the redisService mock in tests/syntheticAssets.unit.test.js to provide proper jest.fn() methods.
  • Added missing babel.config.cjs and ensured it is used by Jest.
  • Adjusted related source files (databaseService.js, redisService.js, syntheticAssetsService.js, logger.js) to align with the new test environment.
    These changes resolve the failing test suite and allow all unit, integration, and e2e tests to pass.

Related Issue

Closes #

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / Code improvement
  • Other (please describe):

🗂️ Affected Area(s)

  • backend/ — Express API routes (/compile, /deploy, /invoke)
  • frontend/ — Next.js UI / Monaco editor
  • contracts/ — Example Soroban contracts
  • .github/ — Templates, workflows, CI
  • Documentation / README
  • Other:

How Has This Been Tested?

  • Ran npm test in the backend directory; all tests passed.
  • Verified that Jest runs without configuration errors.
  • Confirmed the mock behavior works as expected in unit tests.
  • No new console errors or warnings observed.
  • Tested in the browser (local dev server)
  • Verified changes work across different missions
  • Checked Monaco Editor behavior (if applicable)
  • Ran all existing tests (npm test)
  • No new console errors or warnings

Screenshots / Demo (if applicable)

Before

After

Checklist

  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes do not introduce new warnings or errors
  • New and existing tests pass locally

Related Issues or References

Additional Context

This PR addresses the failing test suite caused by Jest misconfiguration with ESM modules and an incorrectly mocked redisService. The changes are limited to the backend and test setup, ensuring no impact on the frontend or contracts.

Closes #501

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@Robinsonchiziterem is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Robinsonchiziterem Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions
Copy link
Copy Markdown

true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement Test Suite for CI/CD Pipeline Setup

1 participant