-
Notifications
You must be signed in to change notification settings - Fork 53
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
test: add tests for react-query
package
#1375
Conversation
|
People can be co-author:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@saul-atomrigs is attempting to deploy a commit to the Toss Team on Vercel. A member of the Team first needs to authorize it. |
CodSpeed Performance ReportMerging #1375 will create unknown performance changesComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1375 +/- ##
==========================================
+ Coverage 72.00% 73.86% +1.85%
==========================================
Files 69 69
Lines 593 593
Branches 134 134
==========================================
+ Hits 427 438 +11
+ Misses 153 144 -9
+ Partials 13 11 -2
|
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.
Thanks for helping me increase my test coverage! I've left a few reviews
const mockConsoleWarn = vi.spyOn(console, 'warn') | ||
const mockGetPackageJson = vi.mocked(getTanStackReactQueryPackageJson) | ||
const mockSwitchVersion = vi.mocked(switchVersion) |
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.
Long but easy to understand is better in my opinion! because we use too many package.json to name it as mockGetPackageJson
const mockConsoleWarn = vi.spyOn(console, 'warn') | |
const mockGetPackageJson = vi.mocked(getTanStackReactQueryPackageJson) | |
const mockSwitchVersion = vi.mocked(switchVersion) | |
const mockConsoleWarn = vi.spyOn(console, 'warn') | |
const mockGetTanStackReactQueryPackageJson = vi.mocked(getTanStackReactQueryPackageJson) | |
const mockSwitchVersion = vi.mocked(switchVersion) |
vi.clearAllMocks() | ||
}) | ||
|
||
it('should switch to version 4 when TanStack Query v4 is installed', async () => { |
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.
In my opinion, It's more easy to understand. Could you reflect this review in your pull request please if you okay?
it('should switch to version 4 when TanStack Query v4 is installed', async () => { | |
it('should switch to @suspensive/react-query-4 when @tanstack/react-query@^4 is installed', async () => { |
I applied the changes, thank you for your feedback, @manudeli ! |
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.
@saul-atomrigs Thanks! Let's improve coverage more 👍
@saul-atomrigs Thanks! |
Overview
Issue #1292
For now, I managed to add tests for
postinstall.ts
and part ofpackage.ts
AS-IS
TO-BE
PR Checklist