From 5cd5d7bb44a89b4a920336a24cf965baeb68cfa8 Mon Sep 17 00:00:00 2001 From: Simon Narendorf Date: Thu, 2 Jan 2025 11:00:26 +0100 Subject: [PATCH] adjusted test cases --- .../__tests__/query/comparison.builder.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/query-mongoose/__tests__/query/comparison.builder.spec.ts b/packages/query-mongoose/__tests__/query/comparison.builder.spec.ts index e2df3f891..2dd8e2e84 100644 --- a/packages/query-mongoose/__tests__/query/comparison.builder.spec.ts +++ b/packages/query-mongoose/__tests__/query/comparison.builder.spec.ts @@ -73,7 +73,7 @@ describe('ComparisonBuilder', (): void => { it('should build like sql fragment', (): void => { expect(createComparisonBuilder().build('stringType', 'like', '%hello%')).toEqual({ stringType: { - $regex: /.*hello.*/ + $regex: /^.*hello.*$/ } }) }) @@ -81,7 +81,7 @@ describe('ComparisonBuilder', (): void => { it('should build notLike sql fragment', (): void => { expect(createComparisonBuilder().build('stringType', 'notLike', '%hello%')).toEqual({ stringType: { - $not: { $regex: /.*hello.*/ } + $not: { $regex: /^.*hello.*$/ } } }) }) @@ -89,7 +89,7 @@ describe('ComparisonBuilder', (): void => { it('should build iLike sql fragment', (): void => { expect(createComparisonBuilder().build('stringType', 'iLike', '%hello%')).toEqual({ stringType: { - $regex: /.*hello.*/i + $regex: /^.*hello.*$/i } }) }) @@ -97,7 +97,7 @@ describe('ComparisonBuilder', (): void => { it('should build notILike sql fragment', (): void => { expect(createComparisonBuilder().build('stringType', 'notILike', '%hello%')).toEqual({ stringType: { - $not: { $regex: /.*hello.*/i } + $not: { $regex: /^.*hello.*$/i } } }) })