test(countdown): improve test coverage#1997
Open
aioya wants to merge 1 commit into
Open
Conversation
|
@aioya is attempting to deploy a commit to the varletjs Team on Vercel. A member of the Team first needs to authorize it. |
@varlet/cli
@varlet/icons
@varlet/import-resolver
@varlet/preset-tailwindcss
@varlet/preset-unocss
@varlet/shared
@varlet/touch-emulator
@varlet/ui
@varlet/use
@varlet/vite-plugins
commit: |
haoziqaq
reviewed
Jun 22, 2026
Comment on lines
+202
to
+210
| const wrapper = mount(Wrapper) | ||
| await delay(0) | ||
|
|
||
| wrapper.vm.$refs.countdown.start() | ||
| wrapper.vm.$refs.countdown.start() | ||
|
|
||
| await delay(50) | ||
|
|
||
| wrapper.unmount() |
Member
There was a problem hiding this comment.
这种 case 感觉用处不大,最好是能整体 review 一下所有的测试 pr。
32d2b40 to
6bb93a6
Compare
Collaborator
Author
There was a problem hiding this comment.
Pull request overview
Improves unit test coverage for the countdown component by adding new test cases around time-prop changes, millisecond formatting tokens, KeepAlive pause/resume behavior, and restart behavior after reaching zero.
Changes:
- Added tests verifying restart behavior when
timeprop changes (with/withoutautoStart). - Added tests for
S/SS/SSSmillisecond formatting and KeepAlive deactivation/activation behavior. - Added a test ensuring
start()after reaching 0 restarts from the fulltimeprop.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
+3
| import { mount } from '@vue/test-utils' | ||
| import { describe, expect, test, vi } from 'vite-plus/test' | ||
| import { createApp } from 'vue' | ||
| import { createApp, defineComponent, KeepAlive } from 'vue' |
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.
Checklist
List of tasks you have already done and plan to do.
Change information
Improve unit test coverage for the countdown component. Pure test additions, no behavior changes.
Issues
N/A
Related Links
N/A