We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这个问题是在使用 jest 的 toMatchSnapshot 时候发现的,debug 了一下发现是下面语句无论如何都会在 mock 的Date.now = jest.fn(() => 1507453184412) 之前执行,所以建议这个语句是不是应该放到 Animate.js class 的内部更好?
jest
toMatchSnapshot
Date.now = jest.fn(() => 1507453184412)
Animate.js
const defaultKey = `rc_animate_${Date.now()}`;
The text was updated successfully, but these errors were encountered:
setupFiles.
Sorry, something went wrong.
其实不能用 setupFiles 来处理,毕竟这个 Date 的 mock 只是在某个测试中使用。
应该使用 enzyme-to-json 的 noKey 属性
enzyme-to-json
noKey
import toJson from 'enzyme-to-json'; expect(toJson(wrapper, {noKey: true})).toMatchSnapshot();
No branches or pull requests
这个问题是在使用
jest
的toMatchSnapshot
时候发现的,debug 了一下发现是下面语句无论如何都会在 mock 的Date.now = jest.fn(() => 1507453184412)
之前执行,所以建议这个语句是不是应该放到Animate.js
class 的内部更好?The text was updated successfully, but these errors were encountered: