Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jest match object properties


describe('location', () => {
  it('should return location object', () => {
    expect( /* Some object value...*/ )
      .toEqual(expect.objectContaining({
        locationId: expect.any(Number),
        geo: expect.any(Array),
        isFetching: expect.any(Boolean)
      }))
  })
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jest #match #object #properties
ADD COMMENT
Topic
Name
3+1 =