17 lines
444 B
JavaScript
17 lines
444 B
JavaScript
import { stemmer } from '../index.mjs';
|
|
|
|
describe('stemmer', () => {
|
|
|
|
test('removes noise', () => {
|
|
expect(stemmer('First National Bank')).toBe('firstnational');
|
|
expect(stemmer('Shell Gas')).toBe('shell');
|
|
expect(stemmer('Verizon Wireless')).toBe('verizon');
|
|
});
|
|
|
|
test('returns empty string if no input', () => {
|
|
expect(stemmer()).toBe('');
|
|
expect(stemmer(null)).toBe('');
|
|
expect(stemmer({})).toBe('');
|
|
});
|
|
|
|
});
|