Skip to content

Content Tagged "mock"

Page 1 of 1

Content Tagged "mock"

Poor Man's Mocks in TypeScript

March 7, 2017Categories: Software, Tutorial
Today I went against my better judgement of usign a mock framework and decided to create my own mocks to allow coverage testing for an IPC-calling code. My reference code I wanted to test is: The code would use an angular service named PathService which, for the purpose of this test only has a…

Mock an Observable Interface

August 1, 2016Categories: Software, Tutorial
TL;DR: Use a doAnswer() with a new Answer<Observable<Type>>() if you have to mock observables. Today I wrote my first test where I had to mock an observable interface: where the User model is: Solution In my test class (named UserDatabaseTest ), I first mocked the interface: Then, my setup…

All tags