Massive refactor to get rid of the global app.

This commit is contained in:
Simon Cambier
2024-05-25 22:49:50 +02:00
parent bbe7b112ed
commit 6566a2e958
24 changed files with 1532 additions and 1146 deletions

View File

@@ -6,7 +6,7 @@ describe('The Query class', () => {
it('should correctly parse string queries', () => {
// Act
const query = new Query(stringQuery)
const query = new Query(stringQuery, { ignoreDiacritics: true })
// Assert
const segments = query.query.text
@@ -25,7 +25,7 @@ describe('The Query class', () => {
it('should not exclude words when there is no space before', () => {
// Act
const query = new Query('foo bar-baz')
const query = new Query('foo bar-baz', { ignoreDiacritics: true })
// Assert
expect(query.query.exclude.text).toHaveLength(0)
@@ -34,7 +34,7 @@ describe('The Query class', () => {
describe('.getExactTerms()', () => {
it('should an array of strings containg "exact" values', () => {
// Act
const query = new Query(stringQuery)
const query = new Query(stringQuery, { ignoreDiacritics: true })
// Assert
expect(query.getExactTerms()).toEqual(['lorem ipsum', 'sit amet'])