In general unit testing, only the test code you write is used.
You can create a layout that is basically a class that uses the methods that you use getor set.
Then you have two options. Either you use Jasmine Spies, which allows you to make fun of the return value of those methods geteither setin your specifications, or you can directly place the return value in the actual Mock class.
The first is more ideal as it allows you to see the return value directly on specand allows for additional customization.
Spy documentation is here . I use spyOn(...).and.returnValue()or a lot, but there are many methods that you can use.
If you give more detailed information in the exact specification that you are trying to write, you can get better answers.
source
share