は、私は、次のネストされた不変のデータ構造を持っていると言う:2つの入れ子になっていない不変のjsデータ構造を深い等価性のためにテストする方法はありますか?
import { Record, List } from 'immutable'
const foo = List([
Record({
id: 1,
gameState: Record({})
})
])
は、どのように私は2つのネストされた不変のjsデータ構造が同じであることをテストでしょうか?
test.js
import jest from 'jest'
import { Record, List } from 'immutable'
describe('test',() => {
it('that foo equals expected',() => {
const expected = List([
Record({
id: 1,
gameState: Record({})
})
])
expect(foo).toEqual(expected)
})