Merge pull request #1384 from strongloop/fix/model-inheritance-test

Fix count of properties
This commit is contained in:
Sakib Hasan 2017-05-24 10:27:54 -04:00 committed by GitHub
commit 0abfceebaa
1 changed files with 7 additions and 5 deletions

View File

@ -184,11 +184,13 @@ describe('Model class inheritance', function() {
if (p.indexOf('__') === 0) { if (p.indexOf('__') === 0) {
continue; continue;
} }
if (typeof customer[p] !== 'function') { // Please note there is an injected id from User prototype which is a function
// On node >= 7, this property does not show up
if (typeof customer[p] !== 'function' && p !== 'id') {
count++; count++;
} }
} }
assert.equal(count, 7); // Please note there is an injected id from User prototype assert.equal(count, 6);
assert.equal(Object.keys(customer.toObject()).filter(function(k) { assert.equal(Object.keys(customer.toObject()).filter(function(k) {
// Remove internal properties // Remove internal properties
return k.indexOf('__') === -1; return k.indexOf('__') === -1;