Skip to content

fix: Move jest-environment-jsdom from dependencies to devDependencies#315

Open
grahammatt wants to merge 1 commit intoamazon-connect:masterfrom
grahammatt:fix/move-jest-environment-jsdom-to-devdeps
Open

fix: Move jest-environment-jsdom from dependencies to devDependencies#315
grahammatt wants to merge 1 commit intoamazon-connect:masterfrom
grahammatt:fix/move-jest-environment-jsdom-to-devdeps

Conversation

@grahammatt
Copy link
Copy Markdown

Fixes #314

Issue

As reported in #314 by @Gabe-Ambrosio, jest-environment-jsdom is listed under dependencies in package.json but is only used as a Jest test environment (via the "testEnvironment": "jsdom" config). This causes consumers of the package to unnecessarily install jest-environment-jsdom and its full transitive dependency tree — including @tootallnate/once, which has a known security vulnerability.

Changes

  • Removed jest-environment-jsdom from dependencies
  • Added jest-environment-jsdom to devDependencies
  • Regenerated package-lock.json

No source code, tests, or configuration were changed.

Testing

  • Ran npm install — clean install with no errors
  • Ran npx jest — all 279 tests pass across 17 test suites
  • No functional impact; this only affects what gets installed when consumers run npm install amazon-connect-chatjs

Note on package-lock.json diff

The lockfile diff also shows the top-level version field changing from 4.0.0 to 5.0.0. This is not a version bump — package.json already has "version": "5.0.0" on master (as released in v5.0.0, commit 667598e). The lockfile was not regenerated during the v5.0.0 release, so npm install corrected the drift.

Notes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…from dependencies to devDependencies

Move jest-environment-jsdom from dependencies to devDependencies (amazon-connect#314)

jest-environment-jsdom is a test-only package and should not be included
in production dependencies. Its presence in dependencies causes consumers
to install it (and its transitive dependency @tootallnate/once, which has
a known security vulnerability) unnecessarily.

The package-lock.json version field also updates from 4.0.0 to 5.0.0
to match package.json, which was already at 5.0.0 on master.
@grahammatt grahammatt requested a review from a team as a code owner March 23, 2026 15:48
@grahammatt grahammatt requested review from bigO68 and haomingli2020 and removed request for a team March 23, 2026 15:48
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-environment-jsdom listed as dependency instead of dev dependency

1 participant