#lil-subscription-testing

1 messages · Page 1 of 1 (latest)

wise hemlockBOT
lucid sail
#

1/ no that's impossible

delicate arrow
#

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

lucid sail
#

lil-subscription-testing

#

@delicate arrow usually you write real code to do all of that for you, no manual entry at all

delicate arrow
#

So it's meant to be something that's done with automated testing

lucid sail
#

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

delicate arrow
#

So you would suggest writing some scripts that hit the test clock endpoints and setup certain scenarios and then advance them?

lucid sail
#

yes that's what my code does for example

delicate arrow
#

It just seems like a lot of work to see what happens if a payment fails a year from now...

lucid sail
#

Not really? It's minutes of work

#

less long that this thread for example

delicate arrow
#

I see... so I'm just missing the simplicity of working with it.

lucid sail
#

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

delicate arrow
#

Yeah repeatable is nice for adding unit tests or something to the integration I suppose

lucid sail
#

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

delicate arrow
#

Does this fire the exact webhooks that actually happen in the wild?

lucid sail
#

yes