nestjs / schematics

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

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

Closed vahidvdn closed 1 month ago

vahidvdn commented 1 month 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 1 month 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