Skip to content

Instantly share code, notes, and snippets.

View ivanbtrujillo's full-sized avatar

Ivanbtrujillo ivanbtrujillo

View GitHub Profile
@ivanbtrujillo
ivanbtrujillo / switch-object.md
Created January 4, 2017 09:17
Don't use switch statement, instead use objects

Stop using switch like this:

switch(value){
  case 'a':
    console.log('value a');
    break;
  case 'b':
    console.log('value b');
 break;
@ivanbtrujillo
ivanbtrujillo / angular2Testing.MD
Last active October 20, 2019 15:51
Angular2 Testing using AngularCli, Jasmine, Karma, Chai and PhantomJS

Angular2 Testing using AngularCli, Jasmine, Karma, Chai and PhantomJS

Tools

For unit testing in Angular2 we can configure a good environment using:

  • Jasmine: a framework to write test
  • karma: a test runner
  • chai: a bdd assertions library
  • Protractor: used to write end-to-end test. It explore the app as users experience it simulating user behaviour.
  • PhantomJS: a script browser to run the angular code and check if it works properly.