withmock
withmock copied to clipboard
Got an error when package name are different
https://github.com/ilovewchao/withmock-test/tree/master/directory-issue
As the example form the link shows, we will get error message like this:
github.com/ilovewchao/withmock-test/directory-issue_test
./foo_test.go:15: undefined: foo.MOCK ./foo_test.go:19: bz.EXPECT undefined (type *foo.Baz has no field or method EXPECT) ./foo_test.go:34: undefined: apps ./foo_test.go:42: undefined: foo.MOCK
I used the "withmock go test", and the package name of the product code and the test code are different.
Mocking the code under test is currently not supported.
Can this be enabled by import the directory of code that is under test in the generated test file?