mirror of
https://github.com/typicode/json-server.git
synced 2025-08-02 19:52:20 +08:00
Add sort test
This commit is contained in:
@ -240,6 +240,13 @@ describe('Server', () => {
|
||||
.expect([db.tags[2], db.tags[0], db.tags[1]])
|
||||
.expect(200))
|
||||
|
||||
it('should reverse sorting with _order=desc (case insensitive)', () =>
|
||||
request(server)
|
||||
.get('/tags?_sort=body&_order=desc')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect([db.tags[2], db.tags[0], db.tags[1]])
|
||||
.expect(200))
|
||||
|
||||
it('should sort on numerical field', () =>
|
||||
request(server)
|
||||
.get('/posts?_sort=id&_order=DESC')
|
||||
|
Reference in New Issue
Block a user