Skip to content

fix: resolve Jest test execution failures (#121)#131

Open
aarush130 wants to merge 1 commit intoopen-amdocs:masterfrom
aarush130:fix/jest-tests-121
Open

fix: resolve Jest test execution failures (#121)#131
aarush130 wants to merge 1 commit intoopen-amdocs:masterfrom
aarush130:fix/jest-tests-121

Conversation

@aarush130
Copy link

This PR fixes the Jest test execution issues reported in #121.

Changes Made

1. Fix TextEncoder is not defined error

  • Modified test/CustomTestEnvironment.js to import TextEncoder and TextDecoder from Node's util module
  • Added conditional checks for Response, Request, and ReadableStream globals

2. Fix Cheerio/Enzyme compatibility issue

  • Added npm overrides in package.json to pin enzyme's cheerio dependency to 1.0.0-rc.12
  • This resolves the Cannot find module 'cheerio/lib/utils' error caused by cheerio 1.0.0's breaking module structure changes

Testing

  • ✅ All 35 test suites pass
  • ✅ 154 tests pass

Fixes #121

- Fix TextEncoder/TextDecoder not defined error by importing from Node's util module

- Add npm overrides to pin cheerio to 1.0.0-rc.12 for enzyme compatibility

- Fixes jsdom polyfill issues and cheerio module structure changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jest tests are not being executed

1 participant