Linked Questions

Popular Questions

Jest Test "Compared values have no visual difference."

Asked by At

I'm doing a comparison between two objects that are quite complex and attempting to use the .toEqual method in expect.

Here is my test:

it('check if stepGroups data in controlData matches data in liveData', () =>    {
    var controlStore = data.controlStore
    var liveStore
    return getData().then(result => {
        liveStore = new Store()
        liveStore.loadData(JSON.parse(result))
        expect(controlStore).toEqual(liveStore)  
    })
})

I did a diff between the expected and the the received output and they both appear to be the same. What would still be causing this test to fail? I was reading up on pretty-format (https://github.com/facebook/jest/issues/1622). Have you run into similar situations?

Related Questions