#JohnTheFrog

1 messages ยท Page 1 of 1 (latest)

safe fulcrumBOT
desert dagger
#

Hello ๐Ÿ‘‹
This error most likely means something in your code is trying to modify the clock before the clock is ready.

gleaming knoll
#

My test case looks like that:

  1. create test clock
  2. create payment method (4242424242424242 card)
  3. Create customer with given payment method and clock
  4. Move the clock back 1 year
  5. Subscribe to annual price
  6. Move the clock 6 month forward
  7. Make the subscription monthly
#

Ah now I see. I can get the test clock status by quering it

#

So I can make a query to stripe api, ie. every 10 seconds for that test clock and check if the status is ready

desert dagger
#

You can, yes. If you have a webhook endpoint then I think we can also send a webhook event for this

gleaming knoll
#

Hmmmm I don't think I can incorporate webhook into a unit test

#

But pooling is also fine, 10 sec is a long period I guess

#

(PHP / Laravel)

desert dagger
#

Gotcha. In certain cases, depending on the time you're advancing your clock to may take a bit longer to be ready.

gleaming knoll
#

I guess so. Thanks ๐Ÿ™‚

desert dagger
#

NP! ๐Ÿ™‚ Happy to help

gleaming knoll
#

Hmmm the clock is ready but the error still occurs

#

welp, I guess I will have to find other way around

desert dagger
#

Hmm, yeah not sure whats going on here.
We typically just recommend stubbing out the mock responses for unit testing

gleaming knoll
#

I can't mock a behaviour I am unsure of ๐Ÿ˜„

The mock server looks neat, for sure it will be useful for rewriting some of the old tests

desert dagger
#

๐Ÿ‘