-
Notifications
You must be signed in to change notification settings - Fork 139
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
支持 Server Mock #217
Comments
@snxq mock测试可以使用 https://github.com/xhd2015/xgo, 在这个PR #218 中我使用xgo替换了gomonkey进行单元测试的mock |
@xhd2015 想要模块测试联调时候的 mock,而不是单测打桩。0.0 |
@snxq 哦,那你可以mock http.Client.Do,当你检测到url参数是wechat server的时候,将它替换为自定义的URL,可以参考https://github.com/xhd2015/xgo/blob/6d0b9575f1b682d155435640a137a3f541ddef82/runtime/test/mock_stdlib/mock_stdlib_test.go#L42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
修改
WechatPayAPIServer
const -> var,支持 server mock。或者在离线环境有没有其他 mock 的方式?core/consts/consts.go
The text was updated successfully, but these errors were encountered: