nestjs / schematics

Nest architecture element generation based on Angular schematics 🎬
https://nestjs.com
MIT License
386 stars 206 forks source link

update controller.spec to mock service instead of real dependency #1847

Closed vahidvdn closed 3 months ago

vahidvdn commented 3 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Currently it's using the real dependency instead of the mocked one which is in contrast to unit testing.

Issue Number: N/A

What is the new behavior?

It mocks the service, so that we can test only one unit (controller)

Does this PR introduce a breaking change?

Other information

kamilmysliwiec commented 3 months ago

which is in contrast to unit testing.

This really depends on your definition of unit tests.

Either way, there are currently no plans to update the default template