Skip to content

Commit 2bd8525

Browse files
committed
Update test for regex with options
1 parent c716a43 commit 2bd8525

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ describe('rsql-mongodb', function () {
5353
expect(rsqlMongoDB('childs=out=(1, 2, 3 )')).to.deep.include({ "childs": { $nin: [1,2,3] } });
5454
});
5555
it("Test operator Like ('=~')", function () {
56-
expect(rsqlMongoDB('lastName=~do*')).to.deep.include({ "lastName": { $regex: "do*" } });
56+
expect(rsqlMongoDB('lastName=~do*')).to.deep.include({ "lastName": { $regex: "do*", $options: "" } });
57+
expect(rsqlMongoDB('lastName=~do*=i')).to.deep.include({ "lastName": { $regex: "do*", $options: "i" } });
58+
expect(rsqlMongoDB('lastName=~do*=mxs')).to.deep.include({ "lastName": { $regex: "do*", $options: "mxs" } });
5759
});
5860
it("Test operator Exists ('=exists=')", function () {
5961
expect(rsqlMongoDB('childs=exists=true')).to.deep.include({ "childs": { $exists: true } });
6062
expect(rsqlMongoDB('childs=exists=false')).to.deep.include({ "childs": { $exists: false } });
6163
expect(rsqlMongoDB('childs=exists=true')).to.be.a('object');
62-
6364
});
6465
it("Test logical operator AND (';')", function () {
6566
expect(rsqlMongoDB('firstName=="john";lastName=="doe"')).to.deep.include({ $and: [ { "firstName" : "john" } , { "lastName" : "doe" } ] });

0 commit comments

Comments
 (0)