From b056255ecd35ae26aa94ea75c4d90b318049c3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 18 May 2018 17:14:05 +0200 Subject: [PATCH] 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). --- .travis.yml | 3 ++- package.json | 2 +- test/loopback-dl.test.js | 19 +++++-------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d0ad987..c60f507f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ sudo: false language: node_js node_js: - - "4" - "6" + - "8" + - "10" diff --git a/package.json b/package.json index c9669b93..a61c3360 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "posttest": "npm run lint" }, "engines": { - "node": ">= 4 <= 6" + "node": ">=6" }, "devDependencies": { "async-iterators": "^0.2.2", diff --git a/test/loopback-dl.test.js b/test/loopback-dl.test.js index 1ab8a439..4c6653b6 100644 --- a/test/loopback-dl.test.js +++ b/test/loopback-dl.test.js @@ -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); });