Private method Unit testing with Jasmine

前端 未结 5 1756
情深已故
情深已故 2021-02-04 01:40

I was coding test cases for an angular application using jasmine. But many internal methods are declared as private in the services.

Example:

App.service         


        
5条回答
  •  清歌不尽
    2021-02-04 01:47

    Is there a specific reason you wish to test your private methods?

    By testing doOfferCal(), you're implicitly testing that myPrivate() is doing the right thing.

    Though this is for RailsConf, Sandi Metz has a very good talk on what should be tested.

提交回复
热议问题