Skip to content

Commit

Permalink
Merge pull request #373 from feathers-plus/ajv-1
Browse files Browse the repository at this point in the history
Revert ajv from 6.1.1 to 5.5.2. Errors testing schemas in existing ajv instances.
  • Loading branch information
eddyystop authored Mar 11, 2018
2 parents 20eddd4 + 7a636b8 commit 5d00020
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 138 deletions.
164 changes: 28 additions & 136 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@feathersjs/commons": "^1.4.0",
"@feathersjs/errors": "^3.3.0",
"@feathersjs/feathers": "^3.1.3",
"ajv": "^6.1.1",
"ajv": "^5.5.2",
"debug": "^3.1.0",
"process": "0.11.10",
"traverse": "^0.6.6"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

const { assert } = require('chai');
const { actOnDefault, actOnDispatch, combine, getItems, replaceItems } = require('../../lib');
const { actOnDefault, actOnDispatch, combine, getItems, replaceItems } = require('../lib');

let hookBefore;

Expand Down
7 changes: 7 additions & 0 deletions tests/services/act-on-dispatch-stub.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


if (process.version.substr(0, 2) >= 'v8') {
require('../../tests-async/act-on-dispatch.test');
} else {
console.log('\n...act-on-dispatch test ignored. Node version is prior to v8.');
}
27 changes: 27 additions & 0 deletions tests/services/discard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,32 @@ describe('services discard', () => {
{ empl: { name: { first: 'John', last: 'Doe' }, status: 'AA' }, dept: 'Acct' }
);
});

it('discards multiple fields', () => {
let hook = {
type: 'after',
method: 'get',
result: {
roles: [ 'super' ],
_id: 'a',
email: 'foo',
password: 'bar',
name: 'Rafael',
id: 'b',
},
query: {},
};

hooks.discard('email', 'password')(hook);

assert.deepEqual(hook.result, {
roles: [ 'super' ],
_id: 'a',
//email: 'foo',
//password: 'bar',
name: 'Rafael',
id: 'b',
});
});
});
});

0 comments on commit 5d00020

Please sign in to comment.