Provides Elixir apps with simple, pragmatic access to magic testing values for the Twilio API. The module and function names help give you code that is easier to read and is less prone to typos. Automated tests in this project also ensure that you will know if the magic numbers ever change.
- Update your
mix.exs
deps.
def deps do
[
...,
{:twilio_magic_values, "~> 1.0", only: :test}
]
end
- Run
mix deps.get
. - No need to modify the
applications
orextra_applications
settings to use this project.
See the docs for all available modules and methods for all known magic numbers.
Use: TwilioMagicValues.Calling.invalid_caller_id/0
alias TwilioMagicValues.Calling
make_test_call(from: Calling.invalid_caller_id(),
to: Calling.invalid_recipient(),
...)
Use: TwilioMagicValues.NumberPurchasing.unavailable_phone_number/0
alias TwilioMagicValues.NumberPurchasing
buy_test_number(exactly: NumberPurchasing.unavailable_phone_number())
Use: TwilioMagicValues.Messaging.blacklisted_recipient/0
alias TwilioMagicValues.Messaging
send_test_message(from: Messaging.valid_sender(),
to: Messaging.blacklisted_recipient(),
...)
- Latest development: December 19, 2020
- Tests passed: December 19, 2020
This project is versioned using the SEMVER 2.0.0 rules.
- Project documentation.
- The Twilio docs for test credentials and magic phone numbers.
- A related blog post by Twilio concerning test credentials and magic phone numbers.
- I wrote about mocking Twilio's webhooks in Paw.
- ex_twilio
- telephonist
- ex_twiml
- Suggestions for this section are welcome. Please open an issue on GitHub.
- Issues and pull requests are welcome on GitHub.
- Twilio doesn't currently provide magic numbers for other parts of their APIs. If they add a new magic number, please open an issue or pull request.
- See
CONTRIBUTING.md
GPL v3; See LICENSE
file.
Written by Scott Swezey.