FE Unit Test

Explaining unit tests for Front End

WHY ARE UNIT TEST IMPORTANT

  • Testing Prevents Anxiety
  • Debugging Process
  • Testing Is Code Documentation
  • Finds Software Bugs Early
  • Quality of Code

UNIT TEST FE FrameWork

It is a behavior-driven development framework for testing JavaScript code

It has a clean, obvious syntax so that you can easily write tests

UNIT TEST FE FrameWork

Syntax

UNIT TEST FE FrameWork

It is to a productive testing environment to developers

It creates a web server that executes source code against test code

UNIT TEST FE FrameWork

DRivers

Karma runs using different browsers to execute the source code

There are multiple drivers, we recommend PhantomJS and Chrome

Practice

Create unit tests Live

Recommendations and good practices

TOpics

  • File Structure
  • Service Mocks
  • Generic Mocks
  • Tests Structure
  • Meaningful tests
Made with Slides.com