4IT580: Docs
4IT580 WebGithub

12th Practical Class:
Unit Testing

Unit Testing: Jest

Simple Unit Test

/sum.js:

/__tests__/sum.js:







React Testing Library

change package.json > "scripts" > "test" to:

src/organisms/__tests__/SingUpForm.js:

Game Of Life

For more information visit the Conway's Game of Life page at Wikipedia.

Rule # 1

Any live cell with fewer than two live neighbors dies, as if by underpopulation.

☠️☠️☠️
☠️🦠☠️
☠️☠️🦠

generation x + 1

☠️

Rule # 2

Any live cell with two or three live neighbors lives on to the next generation.

generation x (n = 2,3)

☠️☠️☠️
🦠🦠☠️
☠️🦠🦠

generation x + 1

🦠

Rule # 3

Any live cell with more than three live neighbors dies, as if by overpopulation.

generation x (n > 3)

🦠🦠🦠
🦠🦠🦠
🦠🦠🦠

generation x + 1

☠️

Rule # 4

Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

generation x (n = 3)

☠️☠️☠️
🦠☠️☠️
☠️🦠🦠

generation x + 1

🦠

All Rules:








Test Drivend Deveopment (TDD)


  1. Write Failing Test
  2. Fix Tests
  3. Refactor
    repeat!






TDD Cycle


1. Write Failing Test


2. Fix Failing Test
(as fast as possible)


3. Refactor


5. Write Failing Test
(repeat!)