Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

How test the method property in Jest/Jasmine unit testing

$
0
0

I need to test the property of the method in jest. My test is passing but test coverage is not increasing.

How test the property of methods?

component.ts

 onClickExpanding() {
        this.ownerName = this.getControl();
        this.quest.parent.children.forEach(c=> c.Grp = false);
        this.quest.Grp = true;
      }

TestCase

it('onClickExpandingtest all property', () => {
  copoment.quest.Grp= true;
  expect(component.onClickExpanding).toBeTruthy();
});

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>