Skip to content

fix: resolve feedbackUtils test relative import and mock localStorage globally#5316

Open
DebasmitaBose0 wants to merge 1 commit into
SandeepVashishtha:masterfrom
DebasmitaBose0:fix/feedback-utils-test-import
Open

fix: resolve feedbackUtils test relative import and mock localStorage globally#5316
DebasmitaBose0 wants to merge 1 commit into
SandeepVashishtha:masterfrom
DebasmitaBose0:fix/feedback-utils-test-import

Conversation

@DebasmitaBose0
Copy link
Copy Markdown
Contributor

Closes #5315

Summary

Fixes import resolution crashes and ReferenceError bugs in tests/feedbackUtils.test.mjs by correcting relative target directories and providing a fully functional localStorage simulation.

Changes Made

  • Updated import to target the valid path ../src/utils/feedbackUtils.js.
  • Constructed an inline globalThis.localStorage mock to safely trap state transactions during testing.
  • Implemented a clean, zero-dependency expect wrapper mapping to native node:assert.

Testing

  • Verified locally by executing:
    node --test --import "data:text/javascript,import { register } from 'node:module'; import { pathToFileURL } from 'node:url'; register('./tests/loaders/jsExtension.mjs', pathToFileURL('./'));" tests/feedbackUtils.test.mjs
  • Outcome: 16/16 tests pass flawlessly.

Impact

Enables automated verification of feedback calculations and export routines, enhancing code coverage metrics.

Checklist

  • Code follows project standards
  • Tested locally
  • No unrelated changes included
  • Responsive design verified
  • Accessibility considered

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@DebasmitaBose0 is attempting to deploy a commit to the sandeepvashishtha's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

gssoc:approved gssoc approved PR merge-conflict This PR has a merge conflict that must be resolved before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Resolve feedbackUtils test relative import and mock localStorage globally

2 participants