Testing

This exercise shows you how test crate propper tests for your angular application.

This project was generated with Angular CLI version 7.3.5.

Tasks

  1. Update the karma.config.js of the project to run the tests with Headless Chrome to set the browsers config-property to ['ChromeHeadless']. In addition, use the krama-spec-reporter instead of the default progress-reporter and configure it:
    plugins: [
      ...
      require('karma-spec-reporter'),
      ...
    ],
    specReporter: {
      suppressSkipped: true,
      showSpecTiming: true,
      failFast: false
    },
    ...
    reporters: ['spec', 'kjhtml'],
  1. Add a test:repl and a test:coverage to your project, which runs the tests in watch mode or generates a coverage-report.
scripts: {
    "test:repl": "ng test --watch",
    "test:coverage": "ng test --code-coverage",
}
  1. Implement the empty specs in 0_pipe.

  2. Implement the empty specs in 1_service.

  3. Implement the empty specs in 2_simple-component.

  4. Implement the empty specs in 3_complex-component.

  5. Install jasmine-marbles and imlement the missing specs in 4_rxjs_marble.

  6. Use the marble syntax to delay the mocked HTTP-request in _complex-component.

  7. Finalize the missing specs in e2e.