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

Change the expected test case result for throttle. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtso
Copy link

@mtso mtso commented Feb 24, 2017

Changes the expected result of the throttle test case named: will execute every threshold ms to [0, 10, 20, 30, 40, 50]. Resolves #33.

Changes the expected result of the test case named: `will execute every threshold ms` to `[0, 10, 20, 30, 40, 50]`.
@kolodny
Copy link
Owner

kolodny commented Feb 28, 2017

There really isn't a clean way to fix this as is. I've changed it to use a kicker. Let me know if that works for you https://github.com/kolodny/exercises/tree/fix-time-issues

@mtso
Copy link
Author

mtso commented Mar 1, 2017

Thank you very much for putting in the time to improve the testing. This repository has been very educational for me.

I have gotten the test to pass several times, but it doesn't appear to work reliably. Using the test file with the kicker, I sometimes get AssertionError: [ 0, 10, 20, 30, 40, 50, 60 ] deepEqual [ 0, 10, 20, 30, 40, 50 ].

I have also gotten variable results like [ 0, 10, 20, 30, 40, 40, 50 ] with unexpected doubled values.

Here's the throttling function I'm using: https://gist.github.com/mtso/1e59a17ccebcba4123b60951072bb359

I recognize now that this might be trickier than I first imagined.

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.

2 participants