Skip to main content
Module

x/fuse/test/feature-flags.test.js

Lightweight fuzzy-search, in JavaScript
Latest
File
// use basic build so that errors are thrownconst Fuse = require('../dist/fuse.basic')import * as ErrorMsg from '../src/core/errorMessages'const Books = require('./fixtures/books.json')
describe('Initialization errors', () => { test('Errors are thrown', () => { expect(() => { new Fuse(Books, { useExtendedSearch: true, keys: ['title'] }) }).toThrowError(ErrorMsg.EXTENDED_SEARCH_UNAVAILABLE)
expect(() => { let fuse = new Fuse(Books, { keys: ['title'] }) fuse.search({ title: 'hello' }) }).toThrowError(ErrorMsg.LOGICAL_SEARCH_UNAVAILABLE) })})