Add support for random delay in ra-data-fakerest#11143
Open
dreglad wants to merge 1 commit intomarmelab:nextfrom
Open
Add support for random delay in ra-data-fakerest#11143dreglad wants to merge 1 commit intomarmelab:nextfrom
dreglad wants to merge 1 commit intomarmelab:nextfrom
Conversation
fzaninotto
approved these changes
Feb 4, 2026
Member
fzaninotto
left a comment
There was a problem hiding this comment.
Great! Would you mind changing the PR target to next instead of master? master is only for bug fixes, new features come to next.
e70724a to
7932f37
Compare
7932f37 to
44e4e48
Compare
Member
|
i rebased your PR on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Previously,
ra-data-fakerestonly supported a fixed delay (in milliseconds). This made it difficult to simulate more realistic, variable network conditions during development or end-to-end testing.Solution
This PR enhances the
delayparameter of thefakeDataProviderto support random ranges:number: Remains supported for fixed delays (backward compatible).boolean: Passing true enables a default random delay between 500ms and 1500ms.object: Passing { min: number, max: number } allows setting a custom random range.How To Test
Added a parameterized test to
packages/ra-data-fakerest/src/index.spec.tsto ensure all scenarios are covered with no breaking changes.Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a feature