Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 264b5e8

Browse files
committed
test(example): add equal to tests to example
1 parent 1bd7a52 commit 264b5e8

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

examples/data.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
[{
22
"name": "Solrenningen",
3+
"visits": 40,
34
"geojson": {
45
"type": "Point",
56
"coordinates": [6.13037, 61.00607]
67
},
78
"tags": ["Ved", "Mat", "Båt"]
89
},{
910
"name": "Norddalshytten",
11+
"visits": 5571,
1012
"geojson": {
1113
"type": "Point",
1214
"coordinates": [5.99579, 61.01340]
1315
},
1416
"tags": ["Ved", "Mat", "Tåke"]
1517
},{
1618
"name": "Åsedalen",
19+
"visits": 10000,
1720
"geojson": {
1821
"type": "Point",
1922
"coordinates": [6.22032, 60.96244]
2023
},
2124
"tags": ["Ved", "Mat", "Stekeovn"]
2225
},{
2326
"name": "Vatnane",
27+
"visits": 9290,
2428
"geojson": {
2529
"type": "Point",
2630
"coordinates": [6.32607, 61.02105]
2731
},
2832
"tags": ["Ved"]
2933
},{
3034
"name": "Selhamar",
35+
"visits": 301,
3136
"geojson": {
3237
"type": "Point",
3338
"coordinates": [6.26495, 60.91275]
3439
},
3540
"tags": ["Ved", "Mat", "Stekeovn", "Båt"]
3641
},{
3742
"name": "Vardadalsbu",
43+
"visits": 30149,
3844
"geojson": {
3945
"type": "Point",
4046
"coordinates": [5.89279, 60.94477]

examples/test.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Example App', function() {
7676
.end(done);
7777
});
7878

79-
it('returns palces with any of the following tags', function(done) {
79+
it('returns places with any of the following tags', function(done) {
8080
app.get(url + '?tags[]=Båt&tags[]=Stekeovn')
8181
.expect(200)
8282
.expect(function(res) {
@@ -87,4 +87,44 @@ describe('Example App', function() {
8787
})
8888
.end(done);
8989
});
90+
91+
it('returns places with visits less than 40', function(done) {
92+
app.get(url + '?visits=<40')
93+
.expect(200)
94+
.expect(function(res) {
95+
assert.equal(res.body.length, 0);
96+
})
97+
.end(done);
98+
});
99+
100+
it('returns places with visits less than or equal to 40', function(done) {
101+
app.get(url + '?visits=<=40')
102+
.expect(200)
103+
.expect(function(res) {
104+
assert.equal(res.body.length, 1);
105+
assert.equal(res.body[0].name, 'Solrenningen');
106+
})
107+
.end(done);
108+
});
109+
110+
it('returns places with visits greater than 10,000', function(done) {
111+
app.get(url + '?visits=>10000')
112+
.expect(200)
113+
.expect(function(res) {
114+
assert.equal(res.body.length, 1);
115+
assert.equal(res.body[0].name, 'Vardadalsbu');
116+
})
117+
.end(done);
118+
});
119+
120+
it('returns places with visits greater than or equal to 10,000', function(done) {
121+
app.get(url + '?visits=>=10000')
122+
.expect(200)
123+
.expect(function(res) {
124+
assert.equal(res.body.length, 2);
125+
assert.equal(res.body[0].name, 'Åsedalen');
126+
assert.equal(res.body[1].name, 'Vardadalsbu');
127+
})
128+
.end(done);
129+
});
90130
});

0 commit comments

Comments
 (0)