Skip to content

Instantly share code, notes, and snippets.

@CodingItWrong
Last active December 23, 2020 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodingItWrong/b127c874bb16c25b3304a8eaf07ae3c4 to your computer and use it in GitHub Desktop.
Save CodingItWrong/b127c874bb16c25b3304a8eaf07ae3c4 to your computer and use it in GitHub Desktop.
JavaScript TDD Live Stream - Dec 22, 2000

JavaScript TDD Live Stream - Dec 22, 2000

Join me at 5 PM ET on my Twitch channel!

Today we'll be working on a code exercise from the JavaScript track of Exercism.io called "D&D Character". In this exercise, we write a class that allows us to generate a character for a role-playing game with random values for different character attributes.

Like all Exercism exercises, this one comes with a prewritten set of tests to guide us. But this time the tests aren't written in the Test-Driven Development style I prefer. We'll look at the tests to see how they aren't enough to fully specify the behavior we want. It's hard to do so when random values are involved! So we'll look at ways we can think about splitting up what is under test and what is not. Along the way we'll uncover an abstraction that will make our tests easier to understand.

My Solution on Exercism.io, including a few final tests for unique attributes and hitpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment