The problem is that mocking in Typescript can get tricky if the object is complex enough (well in any strongly-typed language). You would usually mock some extra stuff just to make code compile and in C# for instance, you can use AutoFixture or similar. On the other hand Javascript is dynamic language and it's possible to mock only part of the object that's needed for test to run.
So in Typescript unit test I can declare my dependency using any
type and thus easily mock it. Do you see any drawbacks of such approach?
let userServiceMock: MyApp.Services.UserService = {
// lots of thing to mock
}
vs
let userServiceMock: any = {
user: {
setting: {
showAvatar: true
}
}
}