@@ -17,38 +17,36 @@ I've been giving a talk on "Testing with Angular".
17
17
18
18
All the scenarios are listed here below and nicely linked to the source file.
19
19
20
- 1 . [ ** Testing Components** ] ( ./src/app/components )
21
- * [ testing @Input ] ( ./src/app/components/input.component.spec.ts )
22
- _ Learn how to a component's ` @Input() ` ._
23
- * [ testing @Output ] ( ./src/app/components/output.component.spec.ts )
24
- _ Learn how to test a component's ` @Output() ` , more specifically the ` EventEmitter ` type._
25
- * [ testing timers inside components] ( ./src/app/components/counter.component.spec.ts )
26
- _ Learn about how to handle timers inside components using ` fakeAsync ` and ` discardPeriodicTasks() ` ._
27
- * [ testing DOM manipulations] ( ./src/app/components/domtesting.component.spec.ts )
28
- _ Learn how to test the DOM manipulations which might be caused by like ` *ngIf ` statements etc._
29
- * [ testing content projection] ( ./src/app/components/content-projection.component.spec.ts )
30
- _ Learn how to test ` <ng-content> ` directives._
31
- * [ testing dynamic CSS classes] ( ./src/app/components/dynamic-css-classes.component.spec.ts )
32
- _ Test CSS classes being added and removed dynamically from your component's template based on some conditional expressions._
33
- * [ testing dynamic CSS styles] ( ./src/app/components/dynamic-styles.component.spec.ts )
34
- _ Test dynamic CSS styles using custom Jasmine matchers._
35
- * [ mocking nested components] ( ./src/app/components/nested.component.spec.ts )
36
- _ Learn how to mock out nested components which you don't want to necessarily test_
37
- * [ async pipes within templates] ( ./src/app/components/async-stream.component.spec.ts )
38
- _ Shows how to correctly resolve async pipes and then verify they properly render in the HTML_
39
- 1 . [ ** Testing Services** ] ( ./src/app/services )
40
- * [ Simple stateless function] ( ./src/app/services/greeting.service.spec.ts )
41
- _ Learn about different ways of injecting a service into a test case as well as how to test service methods._
42
- * [ Async operations] ( ./src/app/services/async.service.spec.ts )
43
- _ Learn how to test async operations using the ` async() ` as well as ` fakeAsync() ` functions._
44
- * Mocking and remote http calls
45
- _ Learn how to mock external dependencies, such as use the ` MockBackend ` provided by Angular to respond to http calls._
46
- * [ Old, < 4.3.1 Http service] ( ./src/app/services/remote.service.spec.ts )
47
- * [ New HttpClient from ` @angular/common/http ` ] ( ./src/app/services/remote-new.service.spec.ts )
48
- 1 . [ ** Testing Pipes** ] ( ./src/app/pipes )
49
- * [ custom filter pipe] ( ./src/app/pipes/filter.pipe.spec.ts )
50
- 1 . [ ** Custom Matchers and Utilities** ] ( ./src/app/utils )
51
- * [ Create your own custom Jasmine matchers] ( ./src/app/utils/custom-matchers.ts )
20
+ 1 . [ ** Testing Components** ] ( ./src/app/components )
21
+ * [ testing @Input ] ( ./src/app/components/input.component.spec.ts )
22
+ _ Learn how to a component's ` @Input() ` ._
23
+ * [ testing @Output ] ( ./src/app/components/output.component.spec.ts )
24
+ _ Learn how to test a component's ` @Output() ` , more specifically the ` EventEmitter ` type._
25
+ * [ testing timers inside components] ( ./src/app/components/counter.component.spec.ts )
26
+ _ Learn about how to handle timers inside components using ` fakeAsync ` and ` discardPeriodicTasks() ` ._
27
+ * [ testing DOM manipulations] ( ./src/app/components/domtesting.component.spec.ts )
28
+ _ Learn how to test the DOM manipulations which might be caused by like ` *ngIf ` statements etc._
29
+ * [ testing content projection] ( ./src/app/components/content-projection.component.spec.ts )
30
+ _ Learn how to test ` <ng-content> ` directives._
31
+ * [ testing dynamic CSS classes] ( ./src/app/components/dynamic-css-classes.component.spec.ts )
32
+ _ Test CSS classes being added and removed dynamically from your component's template based on some conditional expressions._
33
+ * [ testing dynamic CSS styles] ( ./src/app/components/dynamic-styles.component.spec.ts )
34
+ _ Test dynamic CSS styles using custom Jasmine matchers._
35
+ * [ mocking nested components] ( ./src/app/components/nested.component.spec.ts )
36
+ _ Learn how to mock out nested components which you don't want to necessarily test_
37
+ * [ async pipes within templates] ( ./src/app/components/async-stream.component.spec.ts )
38
+ _ Shows how to correctly resolve async pipes and then verify they properly render in the HTML_
39
+ 1 . [ ** Testing Services** ] ( ./src/app/services )
40
+ * [ Simple stateless function] ( ./src/app/services/greeting.service.spec.ts )
41
+ _ Learn about different ways of injecting a service into a test case as well as how to test service methods._
42
+ * [ Async operations] ( ./src/app/services/async.service.spec.ts )
43
+ _ Learn how to test async operations using the ` async() ` as well as ` fakeAsync() ` functions._
44
+ * [ Mocking and remote http calls] ( ./src/app/services/remote.service.spec.ts )
45
+ _ Learn how to mock external dependencies, such as use the ` MockBackend ` provided by Angular to respond to http calls._
46
+ 1 . [ ** Testing Pipes** ] ( ./src/app/pipes )
47
+ * [ custom filter pipe] ( ./src/app/pipes/filter.pipe.spec.ts )
48
+ 1 . [ ** Custom Matchers and Utilities** ] ( ./src/app/utils )
49
+ * [ Create your own custom Jasmine matchers] ( ./src/app/utils/custom-matchers.ts )
52
50
53
51
## Articles on Testing
54
52
@@ -61,9 +59,9 @@ All the scenarios are listed here below and nicely linked to the source file.
61
59
62
60
If you want to run the example locally,
63
61
64
- 1 . clone this repository
65
- 1 . Run ` npm install `
66
- 1 . Run ` npm test ` to execute all the tests
62
+ 1 . clone this repository
63
+ 1 . Run ` npm install `
64
+ 1 . Run ` npm test ` to execute all the tests
67
65
68
66
By running ` npm run test.watch ` you can run the tests in watch mode which is particularly useful during development.
69
67
@@ -73,4 +71,4 @@ Wanna help? Of course! Just open an [issue](https://github.com/juristr/angular-t
73
71
74
72
## Other Links & Resources
75
73
76
- - [ Testing Angular Material Dialog templates] ( http://angular-tips.com/blog/2018/02/testing-angular-material-dialog-templates/ )
74
+ * [ Testing Angular Material Dialog templates] ( http://angular-tips.com/blog/2018/02/testing-angular-material-dialog-templates/ )
0 commit comments