So I want to construct tele.Context instance to pass it as an argument, however nativeContext is not exporter, and to implement tele.Context I need to create a new struct that would implement all of these methods (more than 20).
Would be lovely if telebot would include some implementation of tele.Context that can be used in tests, that would not do any real requests but would return some data that might be configurable.
Something like this would be ideal:
ctx := tele.TestContext{
Sender: { Username: "test" },
Reply: { Error: errors.New("some error"),
}
reporter.HandleHelp(ctx)
// add some asserts that it actually worked correctly
Also pretty sure this might be handy in using the telebot itself.
I use telebot in a few of my apps, and I have a bunch of functions similar to these I want to test:
So I want to construct
tele.Context
instance to pass it as an argument, howevernativeContext
is not exporter, and to implementtele.Context
I need to create a new struct that would implement all of these methods (more than 20). Would be lovely if telebot would include some implementation of tele.Context that can be used in tests, that would not do any real requests but would return some data that might be configurable. Something like this would be ideal:Also pretty sure this might be handy in using the telebot itself.