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
No description provided.
The text was updated successfully, but these errors were encountered:
go testing 支持定制 TestMain func, 可以认为是整个 testing 的 setup 和 teardown 的动作可以在 TestMain 中定义. 如:
func TestMain(m *testing.M) { fmt.Println("About to run tests") defer fmt.Println("Tests are done") os.Exit(m.Run()) }
确认是否可以将 mock message 的动作放到 TestMain 中.
go testing 官方不支持 mocked interface, 目前使用的比较多的是 uber 开源的 https://github.com/uber-go/mock.
确认如何 mock extension, 包括依赖的服务等.
TenEnvTester 要能够被 mocked.
cgo flags 的设置只能有两种方式: 通过 env, 或者 通过 cgo directives (但有个限制, 只能在 源码的 go 文件中, 而不能是 test files. 即 source files 中的 cgo directives 可以自动作用于 test files, 反之则不然). 考虑是否可以在临时目录下生成包含 cgo directives 的文件, 这样就不用设置命令行参数.
考虑如 go binding 这种使用了 go ten package 的 go module 如何单测.
Sorry, something went wrong.
什么是在 TestMain 中 mock message 呀? 有想像中的 sample code 嘛?
确认如何 mock extension, 包括依赖的服务等. TenEnvTester 要能够被 mocked.
目前有需要 mock extension 以及 mock TenEnvTester 嘛?
测试一个 go extension 需要牵涉到 cgo 嘛?
这个目前会有什么问题呢?
leoadonia
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: