woocommerce-ios
woocommerce-ios copied to clipboard
Unit Tests: Add method to randomize dates
At the moment we're hardcoding dates in all our tests, for example ProductVariationMapperTests or ProductVariationsRemoteTests, for multiple parameters like dateCreated
, dateModified
, dateOnSaleStart
, dateOnSaleEnd
An idea from https://github.com/woocommerce/woocommerce-ios/pull/7080#pullrequestreview-1005173104 could be to randomize these, for example in our DateFormatter extension:
I think having a method for randomizing dates is actually a good thought! We could probably add a parameter in that method to make it possible to randomize a date from the past or the future, that will come in handy as well.
Fails | |
---|---|
:no_entry_sign: | Please add a feature label to this issue. e.g. 'feature: stats' |
Generated by :no_entry_sign: dangerJS