Skip to content

Change the expected test case result for throttle.#54

Open
mtso wants to merge 1 commit into
kolodny:masterfrom
mtso:patch-1
Open

Change the expected test case result for throttle.#54
mtso wants to merge 1 commit into
kolodny:masterfrom
mtso:patch-1

Conversation

@mtso

@mtso mtso commented Feb 24, 2017

Copy link
Copy Markdown

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

kolodny commented Feb 28, 2017

Copy link
Copy Markdown
Owner

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

mtso commented Mar 1, 2017

Copy link
Copy Markdown
Author

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