updated tests

This commit is contained in:
herteby 2017-06-26 13:20:32 +02:00
parent 7142f3bc3e
commit 55f593719f

View file

@ -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);
})
});