Skip to content

Commit

Permalink
adjusted test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
simnado committed Jan 2, 2025
1 parent 3cf6798 commit 5cd5d7b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,31 @@ describe('ComparisonBuilder', (): void => {
it('should build like sql fragment', (): void => {
expect(createComparisonBuilder().build('stringType', 'like', '%hello%')).toEqual({
stringType: {
$regex: /.*hello.*/
$regex: /^.*hello.*$/
}
})
})

it('should build notLike sql fragment', (): void => {
expect(createComparisonBuilder().build('stringType', 'notLike', '%hello%')).toEqual({
stringType: {
$not: { $regex: /.*hello.*/ }
$not: { $regex: /^.*hello.*$/ }
}
})
})

it('should build iLike sql fragment', (): void => {
expect(createComparisonBuilder().build('stringType', 'iLike', '%hello%')).toEqual({
stringType: {
$regex: /.*hello.*/i
$regex: /^.*hello.*$/i
}
})
})

it('should build notILike sql fragment', (): void => {
expect(createComparisonBuilder().build('stringType', 'notILike', '%hello%')).toEqual({
stringType: {
$not: { $regex: /.*hello.*/i }
$not: { $regex: /^.*hello.*$/i }
}
})
})
Expand Down

0 comments on commit 5cd5d7b

Please sign in to comment.