Lesson 9: Unit test for fulfillRandomWords
is way too long, but how to break it up?
#692
Unanswered
webthethird
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I'm on the same part now, not 100% sure why it's taking your smaller tests longer but if I had to guess it's because you are now running your BeforeEach way more often, as opposed to just once, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I just finished the unit tests in Lesson 9, and paused for a little while to see if I could break down that last one (i.e.,
"Picks a winner, sends them money and resets the lottery"
) into smaller pieces. That wasn't hard to do, but judging by the amount of time each of them takes, I'm not sure if it's an improvement.Below you can see the output from the tests, along with how long they took:

Most of these smaller tests take as long to execute now as the entire thing did when it was one long
it
with manyassert
statements! Is there any way I could reorganize my code to bring the total executing time down closer to where it was before?(Hopefully this isn't answered in the staging tests section, since I paused the video to post this question)
Below are the separated tests I wrote:
Beta Was this translation helpful? Give feedback.
All reactions