Skip to content

Commit

Permalink
add test for missing document fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaong committed Sep 25, 2018
1 parent 1d82342 commit 81b22d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/MiniSearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ describe('MiniSearch', () => {
ms.add({ id: 1, text: 'Nel mezzo del cammin di nostra vita' })
expect(ms.documentCount).toEqual(1)
})

it('does not throw error if a field is missing', () => {
const ms = new MiniSearch({ fields: ['title', 'text'] })
ms.add({ id: 1, text: 'Nel mezzo del cammin di nostra vita' })
expect(ms.documentCount).toEqual(1)
})
})

describe('addAll', () => {
Expand Down

0 comments on commit 81b22d2

Please sign in to comment.