A coding playground to practice your refactoring skills.
I have crafted this kata for the Refactoring JavaScript course 🎓
It is based on J. B. Rainsberger's Trivia kata, which is itself a fork from a Legacy Code Retreat kata.
Your goal is to refactor Game
without breaking the tests, spending as few time as possible in a "broken" state.
In watch mode, each save will run the tests again.
How short can you spend time between each test? The shortest, the better.
Each time you save and tests stay green is a victory 🏆
Node.js >= v14
and < v17
You can use nvm or n to install a specific version of Node.
- Clone the repository:
git clone git@github.com:nicoespeon/refactoringjavascript-kata.git
- Install dependencies:
npm install
While working, I recommend you run them in watch mode:
npm test -- --watch
You can launch a single test run with npm test
Tests are using Jest to run.
Since this kata is tailored for refactorings, tests are already present. Your goal is NOT to understand, nor update these tests.
If you want to practice writing tests on existing code, I recommend:
- Learn about Approval Testing
- Use one of these refactorings kata
- Have a look at Testing JavaScript course from Kent C. Dodds