Skip to content

Commit 4cd4e22

Browse files
committed
add tests"
git push ` `
1 parent 7c79c33 commit 4cd4e22

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

spec/QueryTools.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,35 @@ describe('matchesQuery', function () {
125125
expect(matchesQuery(obj, q)).toBe(false);
126126
});
127127

128+
it('matches queries with eq constraint', function () {
129+
const obj = {
130+
objectId: 'Person2',
131+
score: 12,
132+
name: 'Tom',
133+
};
134+
135+
const q1 = {
136+
objectId: {
137+
$eq: 'Person2',
138+
},
139+
};
140+
141+
const q2 = {
142+
score: {
143+
$eq: 12,
144+
},
145+
};
146+
147+
const q3 = {
148+
name: {
149+
$eq: 'Tom',
150+
},
151+
};
152+
expect(matchesQuery(obj, q1)).toBe(true);
153+
expect(matchesQuery(obj, q2)).toBe(true);
154+
expect(matchesQuery(obj, q3)).toBe(true);
155+
});
156+
128157
it('matches on equality queries', function () {
129158
const day = new Date();
130159
const location = new Parse.GeoPoint({

0 commit comments

Comments
 (0)