queryfilters
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -13,1 +13,2 @@ # Version 1.0 | ||
- make queries via json | ||
- keep tests separated by feature |
{ | ||
"name": "queryfilters", | ||
"version": "v0.2.0", | ||
"version": "v0.2.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "test": "jest" |
@@ -49,36 +49,1 @@ const QueryQl = require('./queryql'); | ||
}); | ||
test('apply filters with or operator', () => { | ||
var queryQl = new QueryQl() | ||
queryQl.applyFilter({ field: '_embedded.relation.nick', value: '@sensorario' }); | ||
queryQl.applyFilter({ field: '_embedded.foo.bar.name', value: 'Simone' }); | ||
expect(queryQl.setCombinator('or').getQueryString()).toEqual( | ||
'rel=relation,foo,bar' | ||
+ '&or[_embedded.relation.nick]=@sensorario' | ||
+ '&or[_embedded.foo.bar.name]=Simone' | ||
); | ||
}); | ||
test('apply filters with and operator', () => { | ||
var queryQl = new QueryQl() | ||
queryQl.applyFilter({ field: '_embedded.relation.nick', value: '@sensorario' }); | ||
queryQl.applyFilter({ field: '_embedded.foo.bar.name', value: 'Simone' }); | ||
expect(queryQl.setCombinator('and').getQueryString()).toEqual( | ||
'rel=relation,foo,bar' | ||
+ '&and[_embedded.relation.nick]=@sensorario' | ||
+ '&and[_embedded.foo.bar.name]=Simone' | ||
); | ||
}); | ||
test('accept limited list of combinator', () => { | ||
var queryQl = new QueryQl() | ||
var catched = false; | ||
try { | ||
queryQl.setCombinator('invalid').getQueryString() | ||
} catch (e) { | ||
catched = true; | ||
} | ||
expect(catched).toEqual(true); | ||
}); |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
12958
13
274