You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/angular-testing-library/examples.mdx
+14-9
Original file line number
Diff line number
Diff line change
@@ -57,11 +57,13 @@ describe('Counter', () => {
57
57
58
58
## With Standalone Components
59
59
60
-
Angular Testing Library can also test your standalone components.
61
-
In fact, it even becomes easier because you don't have to set up the whole Angular TestBed.
62
-
This was previously only [possible when you used Single Component Angular Modules (SCAMs)](https://timdeschryver.dev/blog/single-component-angular-modules-and-component-tests-go-hand-in-hand).
60
+
Angular Testing Library can also test your standalone components. In fact, it
61
+
even becomes easier because you don't have to set up the whole Angular TestBed.
62
+
This was previously only
63
+
[possible when you used Single Component Angular Modules (SCAMs)](https://timdeschryver.dev/blog/single-component-angular-modules-and-component-tests-go-hand-in-hand).
63
64
64
-
Let's migrate the counter component to a standalone component, and let's take a look at how this affects the test.
65
+
Let's migrate the counter component to a standalone component, and let's take a
66
+
look at how this affects the test.
65
67
66
68
```ts title="counter.component.ts"
67
69
@Component({
@@ -86,8 +88,8 @@ export class CounterComponent {
86
88
}
87
89
```
88
90
89
-
Just as you would've expected, this doesn't affect the test cases.
90
-
Writing tests for standalone components remains the same as for "regular" components.
91
+
Just as you would've expected, this doesn't affect the test cases. Writing tests
92
+
for standalone components remains the same as for "regular" components.
Copy file name to clipboardExpand all lines: docs/angular-testing-library/faq.mdx
+3-2
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,8 @@ As you write your tests, keep in mind:
31
31
32
32
In general, you should avoid mocking out components (see
33
33
[the Guiding Principles section](guiding-principles.mdx)). However, if you need
34
-
to, then try to use [ng-mocks](https://ng-mocks.sudo.eu/) and its [`MockBuilder`](https://ng-mocks.sudo.eu/extra/with-3rd-party#testing-libraryangular-and-mockbuilder).
34
+
to, then try to use [ng-mocks](https://ng-mocks.sudo.eu/) and its
-[Testing Apollo Components Using react-testing-library](https://www.arahansen.com/testing-apollo-components-using-react-testing-library/)
45
45
by [Andrew Hansen](https://twitter.com/arahansen)
46
-
-[Enzyme vs React Testing Library: A Migration Guide](https://claritydev.net/blog/enzyme-vs-react-testing-library-migration-guide) by [Alex Khomenko](https://claritydev.net)
47
-
-[Testing React Hook Form With React Testing Library](https://claritydev.net/blog/testing-react-hook-form-with-react-testing-library) by [Alex Khomenko](https://claritydev.net)
48
-
-[Improving React Testing Library Tests](https://claritydev.net/blog/improving-react-testing-library-tests) by [Alex Khomenko](https://claritydev.net)
49
-
-[Testing Angular Challenges](https://angular-challenges.vercel.app/challenges/testing/) by [Thomas Laforge](https://twitter.com/laforge_toma)
46
+
-[Enzyme vs React Testing Library: A Migration Guide](https://claritydev.net/blog/enzyme-vs-react-testing-library-migration-guide)
47
+
by [Alex Khomenko](https://claritydev.net)
48
+
-[Testing React Hook Form With React Testing Library](https://claritydev.net/blog/testing-react-hook-form-with-react-testing-library)
by [Thomas Laforge](https://twitter.com/laforge_toma)
50
54
51
55
## Portuguese 🇧🇷
52
56
@@ -61,6 +65,7 @@ sidebar_label: Learning Material
61
65
62
66
-[TESTING en REACT 🧪 ¡Aprende DESDE CERO! Con react-testing-library y Jest](https://www.youtube.com/watch?v=KYjjtRgg_H0)
63
67
by [Midudev](https://twitter.com/midudev)
64
-
-[Buenas prácticas con Angular Testing Library](https://dev.to/danyparedes/buenas-practicas-con-angular-testing-library-59lp) by [Danywalls](https://twitter.com/danywalls)
68
+
-[Buenas prácticas con Angular Testing Library](https://dev.to/danyparedes/buenas-practicas-con-angular-testing-library-59lp)
> NOTE: When using `renderHook` in conjunction with the `wrapper` and `initialProps` options, the `initialProps` are not passed to the `wrapper` component.
381
-
> To provide props to the `wrapper` component, consider a solution like this:
380
+
> NOTE: When using `renderHook` in conjunction with the `wrapper` and
381
+
> `initialProps` options, the `initialProps` are not passed to the `wrapper`
382
+
> component. To provide props to the `wrapper` component, consider a solution
0 commit comments