-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: replace commonjs (cjs) with ecmascript modules (esm) #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: zimeg-feat-spell-checks
Are you sure you want to change the base?
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👾 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "test:mocha": "mocha --config .mocharc.json test/*-test.js test/**/*-test.js" |
🪓 chore: Update these scripts
| // 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(), | ||
| })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 question: Is this proper mocking or does this replace what we're testing?
|
|
||
| reportStatus.mockResolvedValue(-205); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📣 question: Hmm...?
| fakeCore.getInput.mockImplementation((input) => { | ||
| if (input === 'codecov_token') return 'abcd1234'; | ||
| if (input === 'codecov_max_attempts') return '2'; | ||
| if (input === 'codecov_retry_delay') return '12'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 note: This was changed to avoid edge cases in timing ranges.
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