mirror of
https://github.com/typicode/json-server.git
synced 2025-08-02 19:52:20 +08:00
Support OR in lists
This commit is contained in:
@ -95,6 +95,14 @@ describe('Server', function () {
|
||||
.expect(200, done)
|
||||
})
|
||||
|
||||
it('should support multiple filters', function (done) {
|
||||
request(server)
|
||||
.get('/comments?id=1&id=2')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect([db.comments[0], db.comments[1]])
|
||||
.expect(200, done)
|
||||
})
|
||||
|
||||
it('should support deep filter', function (done) {
|
||||
request(server)
|
||||
.get('/deep?a.b=1')
|
||||
@ -102,6 +110,14 @@ describe('Server', function () {
|
||||
.expect([db.deep[0]])
|
||||
.expect(200, done)
|
||||
})
|
||||
|
||||
it('should ignore JSONP query parameters callback and _ ', function (done) {
|
||||
request(server)
|
||||
.get('/comments?callback=1&_=1')
|
||||
.expect('Content-Type', /text/)
|
||||
.expect(new RegExp(db.comments[0].body)) // JSONP returns text
|
||||
.expect(200, done)
|
||||
})
|
||||
})
|
||||
|
||||
describe('GET /:resource?q=', function () {
|
||||
|
Reference in New Issue
Block a user