#lil-subscription-testing
1 messages · Page 1 of 1 (latest)
Is there some simpler way to test subscriptions without using test-clocks? It doesn't seem to offer the most intuitive work flow
Lot's of manual entry, then on top of that having to manually copy stripe ids to our database and things like that
lil-subscription-testing
@delicate arrow usually you write real code to do all of that for you, no manual entry at all
So it's meant to be something that's done with automated testing
I mean it doesn't have to be automatic. I'm a developer and I write one-off scripts that allow me to test stuff like this
So you would suggest writing some scripts that hit the test clock endpoints and setup certain scenarios and then advance them?
yes that's what my code does for example
It just seems like a lot of work to see what happens if a payment fails a year from now...
I see... so I'm just missing the simplicity of working with it.
And there are many other ways, which is documented in the doc I linked. You can simply create a Subscription with a trial of a few minutes and wait for the trial end to see what happens after a failure for example
It depends a lot what you're testing, but 99% of the time you're not really testing something random, you want to simulate what your code will experience in the future
and by writing a one-off script that does it all, you kind of make this a lot more repeatable
Yeah repeatable is nice for adding unit tests or something to the integration I suppose
so my script does something like this
1/ Create a Test Clock
2/ Create a Customer with a good test card
3/ Create a Subscription that is active
4/ Advance 2 months, and see the 2 Invoices paid
5/ Change the card to the bad one
6/ Advance 1 month
7/ See Invoice failed payment
and then I duplicate this for various use-cases
Does this fire the exact webhooks that actually happen in the wild?
yes