Checking object equality in Jasmine

前端 未结 5 1761
小蘑菇
小蘑菇 2021-02-01 11:51

Jasmine has built-in matchers toBe and toEqual. If I have an object like this:

function Money(amount, currency){
    this.amount = amou         


        
5条回答
  •  迷失自我
    2021-02-01 12:25

    I found that lodash _.isEqual is good for that

    expect(_.isEqual(result, expectedResult)).toBeTruthy()
    

提交回复
热议问题