js-search
Version:
JS Search is an efficient, client-side search library for JavaScript and JSON objects
22 lines (16 loc) • 589 B
JavaScript
import { ExactWordIndexStrategy } from './ExactWordIndexStrategy';
describe('ExactWordIndexStrategy', function() {
var indexStrategy;
beforeEach(function() {
indexStrategy = new ExactWordIndexStrategy();
});
it('should not expand empty tokens', function() {
var expandedTokens = indexStrategy.expandToken('');
expect(expandedTokens.length).toEqual(0);
});
it('should not expand tokens', function() {
var expandedTokens = indexStrategy.expandToken('cat');
expect(expandedTokens.length).toEqual(1);
expect(expandedTokens).toContain('cat');
});
});