express-json-refiner
Advanced tools
Comparing version
@@ -30,4 +30,3 @@ module.exports = function(grunt) { | ||
ui: 'bdd', | ||
reporter: 'tap', | ||
base: './test' | ||
reporter: 'tap' | ||
}, | ||
@@ -34,0 +33,0 @@ |
{ | ||
"name": "express-json-refiner", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Express JSON refiner middleware by context's scope of api (admin, member...)", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"scripts": { | ||
"test": "mocha test/my.conf.js" | ||
"test": "mocha test/test.spec.js" | ||
}, | ||
@@ -39,3 +39,3 @@ "dependencies": { | ||
"express": "3.4.0", | ||
"grunt": "latest", | ||
"grunt": "latest", | ||
"grunt-contrib-jshint": "latest", | ||
@@ -42,0 +42,0 @@ "grunt-contrib-uglify": "latest", |
@@ -5,3 +5,3 @@ module.exports = function (app) { | ||
model: app.model.model1.schema.paths, | ||
model: app.test.model.model1.schema.paths, | ||
@@ -8,0 +8,0 @@ fields: { |
@@ -5,3 +5,3 @@ module.exports = function (app) { | ||
model: app.model.model2.schema.paths, | ||
model: app.test.model.model2.schema.paths, | ||
@@ -8,0 +8,0 @@ fields: { |
@@ -5,3 +5,3 @@ module.exports = function (app) { | ||
model: app.model.noMongooseSchema, | ||
model: app.test.model.noMongooseSchema, | ||
@@ -8,0 +8,0 @@ fields: { |
@@ -22,3 +22,3 @@ var expect = require('expect.js'), | ||
debug: false, | ||
rules: app.access | ||
rules: app.test.access | ||
}; | ||
@@ -39,3 +39,3 @@ | ||
req.api = {model: 'api1', scope:'admin'}; | ||
req.api = {model: 'api1', scope:'member'}; | ||
@@ -90,6 +90,6 @@ res.json(o); | ||
describe('api1-1', function(){ | ||
it('should filter just first field into array elements', function(done){ | ||
it('should filter first 2 fields into array elements', function(done){ | ||
request(app) | ||
.get('/api1-1/admin') | ||
.expect([{'field1': '1'}], done); | ||
.expect([{'field1': '1','field2': '2'}], done); | ||
}); | ||
@@ -96,0 +96,0 @@ |
14140
0.16%279
-0.36%