theonlychase
10/1/2018 - 12:34 PM

Unit Testing

// End-to-End vs. Unit Tesing
// END-TO-END 
  // - top-down approach where tests are written to determine whether an app has been built appropriately
  // from start to finish. 
  // - We write end-to-end tests as though we are a user's movement throughout the app
  // Nightwatch is often used with Vue apps

// UNIT TESTING
  // - isolating each part of an app and testing it in isolation.
  // - tests are provided a given input and an output is often evaluated to make sure it matches expectations
  // - Mocha and Chai are two popular test environments/suites
  
  // MOCHA
    // - Allows us to specify our test suites with 'describe' and 'it' blocks
    // - 'describe' functions segments each logical unit of tests
    // - inside the describe function we use the 'it' function for each expectation we want to assert
    // - Mocha doesn't have a built in assertion library, which is where Chai comes in
  // CHAI
    // - Provides 3 interfaces for creating assertions:
      // 1. should
      // 2. expect
      // 3. assert
    // - should and expect assertions follow a more behavioural aspect to testing by allowing us to chain
    // assertions together
    
  // vue-test-utils 
    // - Vue's utility library