Skip to content

Fix/statistics export#5011

Closed
Pankajyadav919 wants to merge 8 commits intosugarlabs:masterfrom
Pankajyadav919:fix/statistics-export
Closed

Fix/statistics export#5011
Pankajyadav919 wants to merge 8 commits intosugarlabs:masterfrom
Pankajyadav919:fix/statistics-export

Conversation

@Pankajyadav919
Copy link
Contributor

Changes

  • js/widgets/statistics.js: Changed module.exports = StatsWindow to module.exports = { StatsWindow } to support destructured require syntax (const { StatsWindow } = require('./statistics'))
  • js/widgets/statistics.test.js: Added new unit test file with test case for displayInfo() method, validating Hz calculations and statistics formatting

Testing

  • ✅ Jest test passes locally (1.44s)
  • ✅ ESLint passes (no errors or warnings)
  • ✅ All 4 CI checks pass (Run Jest Tests, Security Scans, Smoke Tests 18x & 20x)

Related Issues

Fixes the failing ESLint check on PR that was preventing merge.

- Changed module.exports to export { StatsWindow } for proper require() destructuring
- Added comprehensive unit test for displayInfo() method in statistics.test.js
- All tests pass locally and ESLint checks pass
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

✅ All Jest tests passed! This PR is ready to merge.

@Inuth0603
Copy link
Contributor

This PR is a duplicate of #4972, which I submitted 5 days ago and is already passing all checks.

We previously discussed this here: #4970 (comment)
In that discussion, you acknowledged you would not open a PR if one was already open. I provided the link to my active PR #4972 at that time.

Furthermore, this new implementation (#5011) introduces a breaking change to the source exports in js/widgets/statistics.js, whereas my PR (#4972) achieves the same test coverage without modifying the source code.

@walterbender @omsuneri Please review #4972 which is the original, non-breaking, and passing submission for this task.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ All Jest tests passed! This PR is ready to merge.

@walterbender
Copy link
Member

duplicate

@Pankajyadav919 Pankajyadav919 deleted the fix/statistics-export branch January 11, 2026 16:18
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.

3 participants