We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d3f900 commit 7c79ad2Copy full SHA for 7c79ad2
src/MiniSearch.test.js
@@ -814,10 +814,18 @@ describe('MiniSearch', () => {
814
815
it('throws an error if removing a field that did not exist', () => {
816
const ms = new MiniSearch({ fields: ['text', 'author'] })
817
- ms.add({ id: 1, author: 'Al et. al.' })
+ ms.addAll([
818
+ { id: 1, author: 'Al et. al.' },
819
+ { id: 2, text: 'Some stuff' }
820
+ ])
821
+
822
expect(() => {
823
ms.removeFields(1, { text: 'Some interesting stuff' })
824
}).toThrow('MiniSearch: field text does not exist on document with ID 1')
825
826
+ expect(() => {
827
+ ms.removeFields(2, { author: 'Someone' })
828
+ }).toThrow('MiniSearch: field author does not exist on document with ID 2')
829
})
830
831
0 commit comments