Skip to content

Latest commit

 

History

History

test-js

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Testing

Testing is very important part of software development process. Tests serve several purposes. Firstly, they check that your code actually does what it is supposed to. Secondly, they act as a safety-net for refactoring big project and allow better code quality and less manual QA. As a bonus, testable code is usually structured and written better than non-tested code. Automated testing frees us from the need of manually testing our code each time, a task that becomes virtually impossible as the code-base grows.

Goals

  1. Get familiar with variety of client-side testing
  2. Practice with tools of writing JS test

Topics

  1. Unit tests
    1. TDD
    2. BDD
  2. UI tests
  3. Tools
    1. Mocha
    2. Chai
    3. Sinon
    4. Jest
    5. Protractor (Selenium)
    6. Puppeteer
  4. Code coverage
  5. Linters: ESLint

Exercise

  1. Implement FizzBuzz function.
  2. Add a test case for each possibility, using Mocha.
  3. Add a FizzBuzz generator function that receives a number N generates a concatenated string with results from #1 from 1 ... N
  4. Add some tests to #3
  5. Make sure all tests run in chrome
  6. Make your test configuration output the code coverage

Resources