From 334c5745d2c8e9f8039bb68b30cbcb80b5cd3bb0 Mon Sep 17 00:00:00 2001 From: Oguzcan Kirmemis Date: Fri, 25 Jun 2021 06:19:38 +0300 Subject: [PATCH] Updated node version to 14 Signed-off-by: Oguzcan Kirmemis --- .circleci/config.yml | 2 +- Dockerfile | 2 +- package.json | 28 +++++------ test/lib/cfenv/lib_readerTests.js | 84 ------------------------------- 4 files changed, 14 insertions(+), 102 deletions(-) delete mode 100644 test/lib/cfenv/lib_readerTests.js diff --git a/.circleci/config.yml b/.circleci/config.yml index e11b660..b29e7a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ executors: TZ: "Europe/Berlin" docker-executor: docker: - - image: circleci/node:10.0 + - image: circleci/node:14.17.1 working_directory: ~/repo environment: shell: /bin/bash diff --git a/Dockerfile b/Dockerfile index eef0df3..a1011ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:10-alpine +FROM node:14-alpine RUN apk add --no-cache ncurses make bash python g++ diff --git a/package.json b/package.json index 0b51661..22030a3 100644 --- a/package.json +++ b/package.json @@ -6,36 +6,32 @@ "main": "server.js", "dependencies": { "request": "^2.34.0", - "async": "^2.6.1", - "log4js": "^3.0.5", + "async": "^3.2.0", + "log4js": "^6.3.0", "hooker": "^0.2.3", "websocket": "^1.0.18", "winston": "^3.1.0", - "pg-hstore": "2.3.2", - "pg": "7.5.0", - "kafka-node": "^3.0.1", + "kafka-node": "^5.0.0", "keycloak-connect": "^12.0.2", "uuid": "3.3.2", - "redis": "^2.8.0" + "redis": "^3.1.2" }, "author": "Intel, CPG", "devDependencies": { - "grunt": "^1.0.3", - "mocha": "^5.2.0", + "grunt": "^1.4.1", + "mocha": "^9.0.1", "istanbul": "^0.4.5", - "rewire": "^4.0.1", - "grunt-cli": "^1.3.1", - "grunt-contrib-jshint": "^2.0.0", - "grunt-eslint": "^21.0.0", - "mocha-teamcity-reporter": "2.5.1", + "grunt-cli": "^1.4.3", + "grunt-contrib-jshint": "^3.0.0", + "grunt-eslint": "^23.0.0", + "mocha-teamcity-reporter": "4.1.0", "jshint-teamcity": "^1.0.4", "asserts": "^4.0.0", "chai": "^4.2.0", - "grunt-contrib-compress": "^1.4.3", + "grunt-contrib-compress": "^2.0.0", "grunt-mocha-istanbul": "^5.0.2", "grunt-istanbul": "^0.8.0", - "sinon": "^6.3.5", "grunt-bumpup": "^0.6.3", - "grunt-shell": "^2.1.0" + "grunt-shell": "^3.0.1" } } diff --git a/test/lib/cfenv/lib_readerTests.js b/test/lib/cfenv/lib_readerTests.js deleted file mode 100644 index 07207d5..0000000 --- a/test/lib/cfenv/lib_readerTests.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (c) 2018, Intel Corporation - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var assert = require('chai').assert, - sinon = require('sinon'), - rewire = require('rewire'); - -var fileToTest = "../../../lib/cfenv/reader.js"; - -var fakeConfig = { - port: "443", - hostname: "streammyiot.com" -}; - -var fakeOs = { - hostname: function(){ - return fakeConfig.hostname; - } -}; - -var fakeVcap_services = { - "cre": {"credentials": "mycredential"} -}; - -var fakeAppEnv = { - url: "https://streammyiot.com", - port: fakeConfig.port -} - -describe(fileToTest, function(){ - var toTest = rewire(fileToTest); - - it('Shall get credentials', function(done){ - toTest.__set__("vcap_services", fakeVcap_services); - assert.equal(toTest.getServiceCredentials("cre"), "mycredential", "get right credential"); - done(); - }); - - it('Shall get empty credentials', function(done){ - toTest.__set__("vcap_services", fakeVcap_services); - assert.deepEqual(toTest.getServiceCredentials("abc"), {}, "get empty credential"); - done(); - }); - - it('Shall get url', function(done){ - toTest.__set__("appEnv", fakeAppEnv); - assert.equal(toTest.getApplicationUri (), "streammyiot.com", "get app url"); - done(); - }); - - it('Shall get Port', function(done){ - toTest.__set__("appEnv", fakeAppEnv); - assert.equal(toTest.getPort(), fakeConfig.port, "get app port"); - done(); - }); - - it('Shall get host', function(done){ - toTest.__set__("os", fakeOs); - assert.equal(toTest.getHost(), fakeConfig.hostname, "get app host"); - done(); - }); - -}); \ No newline at end of file