Fixed internal testing process

This commit is contained in:
Theodor Diaconu 2019-02-15 05:55:49 +02:00
parent 33878ddc8d
commit 2a99080d94
3 changed files with 28 additions and 2 deletions

View file

@ -1,4 +1,5 @@
import { assert } from 'chai';
//import {
// PostCollection,
// CategoryCollection,

View file

@ -822,4 +822,30 @@ describe('Hypernova', function() {
// no link storage
assert.isUndefined(user.shoppingCartsData);
});
it('Should be able to work with custom $filter function and using $and', () => {
ShoppingCart.remove({});
ShoppingCart.insert({ value: 1 });
ShoppingCart.insert({ value: 2 });
ShoppingCart.insert({ value: 3 });
ShoppingCart.insert({ value: 4 });
const data = ShoppingCart.createQuery({
$filter({
filters,
params
}) {
let $or = [];
params.values.forEach(v => $or.push({ value: v }));
filters.$or = $or;
}
}, {
params: {
values: [1, 2]
}
}).fetch();
assert.lengthOf(data, 2);
})
});

View file

@ -30,8 +30,8 @@ Package.onUse(function(api) {
'matb33:collection-hooks@0.8.4',
'reywood:publish-composite@1.5.2',
'dburles:mongo-collection-instances@0.3.5',
'herteby:denormalize@0.6.5',
'peerlibrary:subscription-scope@0.4.0',
'herteby:denormalize@0.6.5',
];
api.use(packages);
@ -50,7 +50,6 @@ Package.onTest(function(api) {
'reywood:publish-composite@1.5.2',
'dburles:mongo-collection-instances@0.3.5',
'herteby:denormalize@0.6.5',
'peerlibrary:subscription-scope@0.4.0',
'mongo',
];