chores
This commit is contained in:
@@ -40,6 +40,14 @@ describe('The Query class', () => {
|
|||||||
).toBeTruthy()
|
).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should not exclude words when there is no space before', () => {
|
||||||
|
// Act
|
||||||
|
const query = new Query('foo bar-baz')
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(query.exclusions).toHaveLength(0)
|
||||||
|
})
|
||||||
|
|
||||||
describe('.getExactTerms()', () => {
|
describe('.getExactTerms()', () => {
|
||||||
it('should an array of strings containg "exact" values', () => {
|
it('should an array of strings containg "exact" values', () => {
|
||||||
// Act
|
// Act
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export async function getSuggestions(
|
|||||||
else results = []
|
else results = []
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
results = results.sort((a, b) => b.score - a.score).slice(0, 50)
|
results = results.slice(0, 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map the raw results to get usable suggestions
|
// Map the raw results to get usable suggestions
|
||||||
|
|||||||
Reference in New Issue
Block a user