using Jasmines spyon upon a private method

前端 未结 9 1607
轻奢々
轻奢々 2021-01-31 01:12

is it possible to use Jasmine unit testing framework\'s spyon method upon a classes private methods?

The documentation gives this example but can this be flexivble for a

9条回答
  •  孤街浪徒
    2021-01-31 01:37

    If you want to test private functions within a class, why not add a constructor to your class that signals that those private functions get returned?

    Have a read through this to see what I mean: http://iainjmitchell.com/blog/?p=255

    I have been using a similar idea and so far its working out great!

提交回复
热议问题