Hey, try separating your large function into smaller ones that can be tested in isolation.
If you have several simple pipes that depend on each other, try combining them in a custom pipe and test that with a mock observable.
So for RxJS, you can:
Test a simple function by using mocked inputs.
Test a custom pipe by using a mocked observable.
Test a custom observable by mocking the sources or events.
My general rule of thumb is that a function should hardly ever have more than two or three tests. When a function requires more than that, you can probably break it down into two or more.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, try separating your large function into smaller ones that can be tested in isolation.
If you have several simple pipes that depend on each other, try combining them in a custom pipe and test that with a mock observable.
So for RxJS, you can:
My general rule of thumb is that a function should hardly ever have more than two or three tests. When a function requires more than that, you can probably break it down into two or more.