Skip to content

Commit 60d7112

Browse files
committed
test(mongoose ilike comparism): Adjusted test case to match like filter correctly
1 parent 27365c2 commit 60d7112

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/query-mongoose/__tests__/query/where.builder.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('WhereBuilder', (): void => {
5454
{
5555
$and: [
5656
{
57-
$and: [{ numberType: { $eq: 1 } }, { stringType: { $regex: /foo.*/ } }, { boolType: { $eq: true } }]
57+
$and: [{ numberType: { $eq: 1 } }, { stringType: { $regex: /^foo.*$/ } }, { boolType: { $eq: true } }]
5858
}
5959
]
6060
}
@@ -88,8 +88,8 @@ describe('WhereBuilder', (): void => {
8888
},
8989
{
9090
$and: [
91-
{ $and: [{ $and: [{ numberType: { $gt: 10 } }, { stringType: { $regex: /foo.*/ } }] }] },
92-
{ $and: [{ $and: [{ numberType: { $lt: 20 } }, { stringType: { $regex: /.*bar/ } }] }] }
91+
{ $and: [{ $and: [{ numberType: { $gt: 10 } }, { stringType: { $regex: /^foo.*$/ } }] }] },
92+
{ $and: [{ $and: [{ numberType: { $lt: 20 } }, { stringType: { $regex: /^.*bar$/ } }] }] }
9393
]
9494
}
9595
)
@@ -147,14 +147,14 @@ describe('WhereBuilder', (): void => {
147147
{
148148
$and: [
149149
{
150-
$and: [{ numberType: { $gt: 10 } }, { stringType: { $regex: /foo.*/ } }]
150+
$and: [{ numberType: { $gt: 10 } }, { stringType: { $regex: /^foo.*$/ } }]
151151
}
152152
]
153153
},
154154
{
155155
$and: [
156156
{
157-
$and: [{ numberType: { $lt: 20 } }, { stringType: { $regex: /.*bar/ } }]
157+
$and: [{ numberType: { $lt: 20 } }, { stringType: { $regex: /^.*bar$/ } }]
158158
}
159159
]
160160
}

0 commit comments

Comments
 (0)