Add support for Node.js 8.x and 10.x, drop 4.x

Also remove a flaky test assertion that reports different results
on different Node.js versions. This assertion has been already
removed on `master` branch (3.x version line).
This commit is contained in:
Miroslav Bajtoš 2018-05-18 17:14:05 +02:00
parent 9917e1d283
commit b056255ecd
No known key found for this signature in database
GPG Key ID: 6F2304BA9361C7E3
3 changed files with 8 additions and 16 deletions

View File

@ -1,5 +1,6 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- "8"
- "10"

View File

@ -29,7 +29,7 @@
"posttest": "npm run lint"
},
"engines": {
"node": ">= 4 <= 6"
"node": ">=6"
},
"devDependencies": {
"async-iterators": "^0.2.2",

View File

@ -1852,24 +1852,15 @@ describe('ModelBuilder processing json files', function() {
customer.should.have.property('bio', undefined);
// The properties are defined at prototype level
assert.equal(Object.keys(customer).filter(function(k) {
should(Object.keys(customer).filter(function(k) {
// Remove internal properties
return k.indexOf('__') === -1;
}).length, 0);
var count = 0;
for (var p in customer) {
if (p.indexOf('__') === 0) {
continue;
}
if (typeof customer[p] !== 'function') {
count++;
}
}
assert.equal(count, 7); // Please note there is an injected id from User prototype
assert.equal(Object.keys(customer.toObject()).filter(function(k) {
})).have.length(0);
should(Object.keys(customer.toObject()).filter(function(k) {
// Remove internal properties
return k.indexOf('__') === -1;
}).length, 6);
})).have.length(6);
done(null, customer);
});