-
-
Notifications
You must be signed in to change notification settings - Fork 278
feat: validate support dirty #625
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
export async function waitFakeTime(timeout: number = 10) { | ||
await act(async () => { | ||
await Promise.resolve(); | ||
jest.advanceTimersByTime(timeout); |
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.
await 加到这里也可以吧?不需要 Promise.resolve
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.
jest.advanceTimersByTime
不是 async 函数,加了 await 会报错。
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 会挂
Codecov Report
@@ Coverage Diff @@
## master #625 +/- ##
=======================================
Coverage 99.43% 99.43%
=======================================
Files 18 18
Lines 1229 1236 +7
Branches 282 283 +1
=======================================
+ Hits 1222 1229 +7
Misses 7 7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
<InfoField name="validate" rules={[{ required: true, message: validateMessage }]}> | ||
<Input /> | ||
</InfoField> | ||
<InfoField name="noop" rules={[{ required: true, message: 'noop' }]}> |
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.
noop 这个用了吗
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.
不用,为了检测 dirty 不会校验 noop
ref ant-design/ant-design#42347