DEV Community

Discussion on: What is a Unit in unit testing

Collapse
 
vlasales profile image
Vlastimil Pospichal
  1. All
  2. No
Collapse
 
s_anastasov profile image
Stojan Anastasov

I agree on point 1.

Can you elaborate on point 2?

Collapse
 
vlasales profile image
Vlastimil Pospichal

You must isolate dependencies.

When test failed, where is the error? This is in the unit or in the dependency? When you use a mock, you will know where it is.

You may use more mocks for more test scenarios too.