Contributions are welcome!
- Fork repository
- Do some changes
- Create pull request
- Wait for CI build and review
- ??????
- PROFIT
Bear in mind that the CI build won't run integration test suite against your pull request since the necessary environment
variables ($BOT_TOKEN
, $STRIPE_TOKEN
, $CHAT_ID
and $BOT_NAME
) aren't exported when a fork
starts the build (for security reasons). If you do want to run them before creating RP, you can setup integration of your fork
with CircleCI.
You can use stack
to build project
stack build
To run test you have to create your own bot. Go to BotFather and create the bot. As the result you will have private bot's access token. Keep it safe!
stack test --test-arguments "--integration -c CHAT_ID -b BOT_NAME -- HSPEC_ARGS"
where
BOT_TOKEN
is the token obtained from BotFather and must be defined as environment variablePAYMENT_TOKEN
is the token obtained from BotFather and must be defined as environment variableCHAT_ID
can be id of your chat with your bot. Send some messages to this chat in Telegram and docurl "https://api.telegram.org/bot<replace_with_token>/getUpdates"
, you'll have to parse some JSON with your brain ;-) or any other suitable tool and you will find chat id there.BOT_NAME
is the name of your botHSPEC_ARGS
are the normalhspec
arguments you can find [here][hspec-args]
The help option is available for the tests and for hspec:
stack test --test-arguments "-h"
stack test --test-arguments "--integration -c CHAT_ID -b BOT_NAME -- -h"
Note: Inline Spec is disabled for now...
If everything is fine after running the tests you will receive a few new messages from your bot.