-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #648: Add setDefaultWaitOptions
function
#658
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #658 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 235 236 +1
Branches 33 33
=========================================
+ Hits 235 236 +1
Continue to review full report at Codecov.
|
Thanks @orokanasaru for putting this together. Your comments about docz running on the PR pipeline made me wonder because I thought we had Netlify deploy preview running on All PR branches... Turns out that our Netlify config was never updated when we switched from Unfortunately you're correct about the build issue for docz which appears to be an open issue for them. I'm reluctant to release a new feature without the accompanying documentation and I'm more reluctant to remove the repo field from the Honestly, this is not the first time docz has just randomly broken on us and I've been considering migrating the docs to something else for a while now. This may be the final trigger for it (we'll see how my investigation tonight into working around it goes). I'll give the changes a review now anyway. |
const DEFAULT_INTERVAL = 50 | ||
const DEFAULT_TIMEOUT = 1000 | ||
let defaultInterval: number | false = 50 | ||
let defaultTimeout: number | false = 1000 | ||
|
||
function setDefaultWaitOptions({ interval, timeout }: WaitOptions) { | ||
defaultInterval = interval ?? defaultInterval | ||
defaultTimeout = timeout ?? defaultTimeout | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need some way of resetting the defaults back to the initial values?
I'm just thinking about someone that wants to update the defaults for a single test file so they set it in the beforeAll
and want to reset it in the afterAll
. Because we don't export the initial default values, they would have to just hard code the documented default values and hope we never change them.
The options I see are:
- export some constants for them to use with
setDefaultWaitOptions
- export a
resetDefaultWaitOptions
utility
Or maybe both? Or maybe there's another option I'm not seeing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think exporting the constants makes more sense than a function imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been wondering about new options into renderHook
? A render helper can then be extracted like normal for shared setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpeyper, can you expand on your idea? I will export initial constants otherwise
I am also interested into a better workaround for that |
@silviuaavram sorry, I don't have any good news. I'm currently porting our docs over to docusaurus 🤷♂️ |
Cool :). While doing this you could probably work around as I did now, doczjs/docz#1635 (comment). Let me know if this works for you! |
Co-authored-by: Michael Peyper <[email protected]>
Hi @orokanasaru, just checking in to see where you're at with this. Is it still something you want to pursue? |
@mpeyper, you said you did not want to release until you resolved the documentation issues. If that is no longer a blocker, I can return to finish this up |
@orokanasaru yeah, for sure. What are your thoughts on the thread about resetting the values? |
What:
Fix for #648. Add
setDefaultWaitOptions
functionWhy:
It simplifies configuration in environments where the defaults may not be optimal
How:
Checklist:
Had issues with
docz
. Needed to removerepo
field frompackage.json
and update glob pattern forfiles
indoczrc.js
to build updated documentation. These changes are not included as they presumably do not apply to the pipeline here