Skip to content
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

Added a check for 0 ms in pause command #3534

Merged
merged 3 commits into from Jan 4, 2023

Conversation

prudhvi22
Copy link
Contributor

fixes #3422

@@ -42,7 +42,7 @@ Pause.prototype.command = function(ms, cb) {
// If we don't pass the milliseconds, the client will
// be suspended indefinitely, until the user presses some
// key in the terminal to resume it.
if (!ms) {
if (!ms && ms !== 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make it if (ms === undefined) { instead? Because that's only when we should pause indefinitely (if the first argument is undefined). If something else is passed as the first argument which is falsy (null, false for ex.), then we should just let it go to the else clause and let setTimeout through an error, instead of pausing indefinitely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Will make changes.

@beatfactor beatfactor merged commit fdadd08 into nightwatchjs:main Jan 4, 2023
@qwertynik
Copy link

Thanks, @garg3133 for your involvement in this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client.pause(0) leads to indefinite wait time
5 participants