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
- Update the
karma.config.js
of the project to run the tests withHeadless Chrome
to set the browsers config-property to['ChromeHeadless']
. In addition, use thekrama-spec-reporter
instead of the defaultprogress
-reporter and configure it:
plugins: [
...
require('karma-spec-reporter'),
...
],
specReporter: {
suppressSkipped: true,
showSpecTiming: true,
failFast: false
},
...
reporters: ['spec', 'kjhtml'],
- Add a
test:repl
and atest: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",
}
-
Implement the empty specs in
0_pipe
. -
Implement the empty specs in
1_service
. -
Implement the empty specs in
2_simple-component
. -
Implement the empty specs in
3_complex-component
. -
Install
jasmine-marbles
and imlement the missing specs in4_rxjs_marble
. -
Use the marble syntax to delay the mocked HTTP-request in
_complex-component
. -
Finalize the missing specs in
e2e
.