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

Issue with sendBatchTimeout and using protractor #186

Open
Emilio-K opened this issue Jul 16, 2019 · 0 comments
Open

Issue with sendBatchTimeout and using protractor #186

Emilio-K opened this issue Jul 16, 2019 · 0 comments

Comments

@Emilio-K
Copy link

Emilio-K commented Jul 16, 2019

Hi, I am using jsnlog for angular 6, and I have got everything working. However when I try to do e2e tests with it, there is an issue with the sendBatchTimeout.

Protractor is waiting for all angular tasks to finish which includes the sendBatchTimeout, which will have a default value of max integer, so the tests will never run because of this timeout going on. Inside jsnlog.js in the function setTimer, I have made a change to adjust for this, if timeoutMs is the default value which is 2147483647 then it doesn't set a timeout.

if(timeoutMs !== 2147483647){ 
                timer.id = setTimeout(function () {
                    // use call to ensure that the this as used inside sendBatch when it runs is the
                    // same this at this point.
                    callback.call(that);
                }, timeoutMs);
}

Is there anything like this you would consider adding to the src? Because I would like to use sendBatch but not have that infinite timer nor send them before it reaches the batch size.

Thanks.

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

No branches or pull requests

1 participant