diff --git a/lib/query/testing/server.test.js b/lib/query/testing/server.test.js index 0e3a577..539b967 100644 --- a/lib/query/testing/server.test.js +++ b/lib/query/testing/server.test.js @@ -368,10 +368,10 @@ describe('Hypernova', function () { assert.isFunction(clone.setParams({}).fetchOne); }); - it('Should work with $postFilter', function () { + it('Should work with $postFilters', function () { let query = createQuery({ posts: { - $postFilter: { + $postFilters: { 'comments.text': 'Non existing comment', }, title: 1, @@ -386,7 +386,7 @@ describe('Hypernova', function () { query = createQuery({ posts: { - $postFilter: { + $postFilters: { 'comments.text': 'Good', }, title: 1, @@ -398,4 +398,23 @@ describe('Hypernova', function () { assert.isTrue(query.fetch().length > 0); }) + + it('Should work with $postOptions', function () { + let query = createQuery({ + posts: { + $postOptions: { + limit:5, + skip:5, + sort:{title:1} + }, + title: 1, + comments: { + text: 1 + } + } + }); + + const data = query.fetch(); + assert.lengthOf(data, 5); + }) });