Commit fcde2a8
authored
test(angular): Increase Angular SDK Test Coverage. (#5790)
Increase unit test coverage of Angular SDK by integrating [`TestBed`](https://angular.io/api/core/testing/TestBed).
The main work here is done on [`tracing.ts`](https://github.com/getsentry/sentry-javascript/blob/12c19d051eca4fcef316ba6ee512f1221ae92ef0/packages/angular/src/tracing.ts) which had low test coverage, and the previous tests were [faking the angular router](https://github.com/getsentry/sentry-javascript/blob/12c19d051eca4fcef316ba6ee512f1221ae92ef0/packages/angular/test/tracing.test.ts#L72-L79).
I attempted to use `@testing-library/angular` to be consistent with other SDK tests like `@sentry/react` and `@sentry/svelte`, but it was not possible as [it doesn't support renders without compiled components](https://github.com/testing-library/angular-testing-library/blob/36648c4b431a9e17efa1f59cc2d83710c17a42ee/projects/testing-library/src/lib/testing-library.ts#L43-L89) which we need while testing [`TraceService`](https://github.com/getsentry/sentry-javascript/pull/5790/files#diff-d46ba52093e0179db0bc8dfa1887658374319ebf783602153a45f0e4f4b06e72R55-R72).1 parent 2b8237c commit fcde2a8
File tree
8 files changed
+505
-122
lines changed- packages/angular
- test
- utils
8 files changed
+505
-122
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
124 | 148 | | |
0 commit comments