Skip to content

ci: use npm ci and drop the unused jest toolchain#981

Open
Anexus5919 wants to merge 1 commit into
Somil450:mainfrom
Anexus5919:fix/ci-use-npm-ci
Open

ci: use npm ci and drop the unused jest toolchain#981
Anexus5919 wants to merge 1 commit into
Somil450:mainfrom
Anexus5919:fix/ci-use-npm-ci

Conversation

@Anexus5919

Copy link
Copy Markdown
Contributor

📌 Related Issue

Fixes #897
Fixes #900
Fixes #901


📝 Description

Dependency, lockfile, and test-toolchain hygiene. These three are bundled because they all regenerate the root package-lock.json and depend on the same @testing-library/dom fix, so splitting them would mean three mutually-conflicting lockfiles.

🔹 What has been changed?

  • CI uses npm install, not npm ci (and the root lockfile is out of sync, blocking npm ci) #897 (CI uses npm install, lockfile out of sync): CI installed with npm install, which ignores the lockfile (non-reproducible). Switching to npm ci requires package.json and the lockfile to be in sync, which they were not: @tensorflow/tfjs / @tensorflow/tfjs-layers are in package.json but were absent from the root lockfile, so npm ci failed on the frontend (the server/ lockfile was already in sync). Regenerated the root lockfile so it is in sync, and switched both CI install steps (frontend and backend) to npm ci.
  • Orphan Jest toolchain (jest.config.cjs + jest devDeps) remains after vitest migration; CHANGELOG says removed #900 (orphan Jest toolchain): the project runs on vitest, but jest.config.cjs and the jest / ts-jest / jest-environment-jsdom / @types/jest devDependencies were left behind (the CHANGELOG already claims they were removed). Deleted the config file and the four orphan devDependencies. Kept @testing-library/jest-dom (the jest-dom matchers, used by the vitest setup).
  • test:coverage fails: @vitest/coverage-v8 provider is not installed #901 (test:coverage provider missing): test:coverage runs vitest run --coverage, but no coverage provider was installed. Added @vitest/coverage-v8 pinned to vitest's version (4.1.7).
  • Declared @testing-library/dom as a direct devDependency: regenerating with npm 10 otherwise drops it (it is only a transitive dep of @testing-library/react), which breaks React Testing Library under npm ci.

🔹 Why are these changes needed?

  • npm ci gives reproducible, lockfile-pinned installs and is the correct command for CI, but it only works once package.json and the lockfile agree, which is the same out-of-sync state issue CI uses npm install, not npm ci (and the root lockfile is out of sync, blocking npm ci) #897 reports. The orphan Jest packages are dead weight after the vitest migration, and test:coverage is currently broken without the v8 provider. Pinning @testing-library/dom keeps the RTL setup working across lockfile regenerations.

🛠️ Type of Change

  • 🐛 Bug Fix
  • 🔧 Refactoring

🧪 Testing

✅ Tests Performed

  • Tested locally
  • npm ci --dry-run exits 0 for both the repo root and server/.
  • Lockfile checks: @testing-library/dom@10.4.1 present; @tensorflow/tfjs@4.22.0 now present (was missing); vitest and @vitest/coverage-v8 both 4.1.7; jest / ts-jest / jest-environment-jsdom / @types/jest absent.
  • Confirmed no source/config/script in the repo still references jest (test runner is vitest run).

🔹 Note on automated tests

Lockfile regenerated with npm install --package-lock-only (no node_modules write), so the local environment is untouched and the diff is limited to the lockfile metadata.

🌐 Browsers Tested

Not applicable (CI / dependency configuration).


📷 Screenshots / Demo (if applicable)

Not applicable.


📋 Checklist

  • I have read the project's CONTRIBUTING guidelines
  • My code follows the project style guidelines
  • I have performed a self-review of my code
  • I have tested my changes locally
  • I have added/updated documentation where necessary (not applicable)
  • My changes do not introduce new warnings or errors
  • This PR is linked to an existing issue

💬 Additional Notes

Branched fresh from upstream/main and the lockfile regenerated against the current base, so it merges cleanly (the previous version of this branch conflicted only on the regenerated lockfile). Declaring @testing-library/dom directly also resolves the long-standing eviction, so React Testing Library component tests can run again under npm ci.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Anexus5919 is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Anexus5919

Copy link
Copy Markdown
Contributor Author

@Somil450 @diksha78dev Kindly have a review on this pr. Thanks!

@Anexus5919 Anexus5919 force-pushed the fix/ci-use-npm-ci branch from 4d8f420 to db338cb Compare July 1, 2026 07:36
CI installed deps with npm install (ignores the lockfile); switch the
frontend and backend steps to npm ci for reproducible installs. Sync the
root lockfile (adds the missing TensorFlow tree) so npm ci passes; both
package-lock files verify with npm ci --dry-run.

Remove the unused jest devDeps (jest, jest-environment-jsdom, ts-jest,
@types/jest) and jest.config.cjs: the test runner is vitest and nothing
references jest. Add @vitest/coverage-v8 (required by the test:coverage
script) and @testing-library/dom as a direct devDep so npm ci keeps it
for the React Testing Library setup.
@Anexus5919 Anexus5919 force-pushed the fix/ci-use-npm-ci branch from db338cb to 999af0a Compare July 1, 2026 07:36
@Anexus5919

Copy link
Copy Markdown
Contributor Author

@Somil450 @diksha78dev Kindly have a review on this pr. Thanks!

@Anexus5919

Copy link
Copy Markdown
Contributor Author

This failing check is from main, not this PR. Main's CI is currently broken (ShieldAlert used without importing it, plus untyped "privacy"/"terms&conditions" screens), so every PR goes red, even docs-only ones. Fix is up in #1039. Once it merges, a rebase turns this green. Merges cleanly with base.

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

Labels

None yet

Projects

None yet

1 participant