In this lesson, we'll explore the benefits of working with small commits and maintaining functional code at every step. We'll use a simple TypeScript calculator project and add basic operations one by one, pairing each change with its corresponding unit test using Jest. After completing the initial development, we'll introduce git bisect to demonstrate how small commits make debugging easier.
The calculator project should reflect the same stack we're using: Typescript, and jest.
The code should be added into a src
folder which can be built using typescipt, and the scripts in package.json
should also reflect the same scripts we usually work with in our repos (build
, start
, test
, and test:watch
)
Ofc this example is minimal to show the git changes more clearly and our real application code usually is harder to apply these techniques, but the examples in this lesson should give you a starting point on how to approach this.