You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While fast-check offers a simple way to replay failures based on seed and path, schedulers cannot be replayed using the the examples options offered on fc.assert.
While working on the PR facebook/react#18721 on React, I have been challenged on this topic: it should be easier to set custom examples related to schedulers.
Example
Among the possible options here are some that came in my mind to offer this kind of capabilities on schedulers:
fc.assert(fc.property(fc.scheduler(),()=>{/*code*/}),{examples: [// scheduler resolving tasks in the order 1, 5, 4, 3, 2fc.schedulerFor([1,5,4,3,2]/*, opt constraints*/),// same scheduler but this one is one copied and pasted from previous tests failuresfc.schedulerFor(/*opt constraints*/)` -> [task#${1}] promise pending -> [task#${5}] promise pending -> [task#${4}] promise pending -> [task#${3}] promise pending -> [task#${2}] promise pending `]});
One of the issue we have today is that fc.scheduler can be receive a custom act function and we will also need to pass it to the schedulerFor and this why we use schedulerFor(). Alternatively we may configure this custom act later in the code 🤔
The text was updated successfully, but these errors were encountered:
🚀 Feature Request
Easier replay of failing scheduler
Motivation
While fast-check offers a simple way to replay failures based on
seed
andpath
, schedulers cannot be replayed using the theexamples
options offered onfc.assert
.While working on the PR facebook/react#18721 on React, I have been challenged on this topic: it should be easier to set custom examples related to schedulers.
Example
Among the possible options here are some that came in my mind to offer this kind of capabilities on schedulers:
One of the issue we have today is that
fc.scheduler
can be receive a customact
function and we will also need to pass it to theschedulerFor
and this why we useschedulerFor()
. Alternatively we may configure this customact
later in the code 🤔The text was updated successfully, but these errors were encountered: