refactor: replace commonjs (cjs) with ecmascript modules (esm)#108
Closed
zimeg wants to merge 8 commits intozimeg-feat-spell-checksfrom
Closed
refactor: replace commonjs (cjs) with ecmascript modules (esm)#108zimeg wants to merge 8 commits intozimeg-feat-spell-checksfrom
zimeg wants to merge 8 commits intozimeg-feat-spell-checksfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## zimeg-feat-spell-checks #108 +/- ##
============================================================
- Coverage 94.66% 62.43% -32.24%
============================================================
Files 6 8 +2
Lines 375 378 +3
Branches 0 57 +57
============================================================
- Hits 355 236 -119
- Misses 20 142 +122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
commented
Aug 2, 2025
Member
Author
zimeg
left a comment
There was a problem hiding this comment.
👾 Quick notes for the editor and reviewers!
| "test": "npm run lint && c8 npm run test:mocha", | ||
| "test": "npm run lint && vitest run --coverage", | ||
| "test:watch": "vitest", | ||
| "test:mocha": "mocha --config .mocharc.json test/*-test.js test/**/*-test.js" |
Member
Author
There was a problem hiding this comment.
Suggested change
| "test:mocha": "mocha --config .mocharc.json test/*-test.js test/**/*-test.js" |
🪓 chore: Update these scripts
Comment on lines
+3
to
+14
| // Mock the dependencies first | ||
| vi.mock('../src/score_components/find-problematic-comments.js', () => ({ | ||
| default: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock('../src/score_components/coverage.js', () => ({ | ||
| default: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock('../src/report.js', () => ({ | ||
| default: vi.fn(), | ||
| })); |
Member
Author
There was a problem hiding this comment.
🔍 question: Is this proper mocking or does this replace what we're testing?
Comment on lines
+259
to
+261
|
|
||
| reportStatus.mockResolvedValue(-205); | ||
|
|
| fakeCore.getInput.mockImplementation((input) => { | ||
| if (input === 'codecov_token') return 'abcd1234'; | ||
| if (input === 'codecov_max_attempts') return '2'; | ||
| if (input === 'codecov_retry_delay') return '12'; |
Member
Author
There was a problem hiding this comment.
🔍 note: This was changed to avoid edge cases in timing ranges.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors logic and tests to use ESM for build problems found in a downstream prerelease using the changes of both #104 and #105 🤖
🔗 slackapi/slack-github-action#484 (comment)
Requirements