This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Adding line number of caller #20
Closed
Description
Our team is really enjoying the mock support. Is there a way to get the controller to print the caller class and line number...
For example
--- FAIL: TestGetMany (0.00s)
controller.go:113: no matching expected call: *lcp_mock.MockOrdersInterface.GetMany([context.Background wpID userID lpID confirmationNumber [statuses] [orderTypes]])
controller.go:158: missing call(s) to *ids_mock.MockContextService.GetAccessToken(is anything, is anything, is anything)
controller.go:158: missing call(s) to *lcp_mock.MockOrdersInterface.GetMany(is anything, is equal to accessToken, is equal to userID, is equal to lpID, is equal to confirmationNumber, is equal to [statuses], is equal to [orderTypes])
controller.go:165: aborting test due to missing call(s)
Instead of controller.go:113 or 158, could the name of the function caller be included in the error message? This would help identify where in the code is actually trying to use the mock.
Thanks for this great library!
Metadata
Metadata
Assignees
Labels
No labels