Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
srware committed Jul 24, 2019
2 parents e042284 + 3fa57e6 commit 0f1cbb1
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ results
node_modules
*.idea/*
*.orig
*/coverage/*
*/dist/*
coverage
dist
*~
74 changes: 13 additions & 61 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

module.exports = function(grunt) {
// Project configuration.
var buildID = grunt.option('buildID') || 'local';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
dirs: {
Expand All @@ -37,24 +36,6 @@ module.exports = function(grunt) {
'*.js'],
testfiles: ['test/*.js']
},
license_finder: {
default_options: {
options: {
production: false,
directory: process.cwd(),
csv: true,
out: 'licenses.csv'
}
},
production : {
options: {
production: true,
directory: process.cwd(),
csv: true,
out: 'licenses_production.csv'
}
}
},
eslint: {
local: {
src: ['<%= dirs.jsfiles %>'],
Expand All @@ -69,57 +50,28 @@ module.exports = function(grunt) {
}
}
},
compress: {
teamcity: {
nyc: {
all: {
options: {
archive: 'dist/'+'<%= pkg.name %>_' + buildID + ".tgz",
mode: 'tgz'
include: ['api/**', 'lib/**'],
recursive: true,
reporter: ['lcov', 'text-summary'],
reportDir: 'dist/coverage',
tempDir: 'dist/temp',
all: true
},
files: [{cwd: '.',
expand: true,
src: ['**/*.js', '**/*.sh', 'config.json', '!node_modules/**', '!dist/**', '!test/**', '!Gruntfile.js'],
/* this is the root folder of untar file */
dest: '<%= pkg.name %>/'
}]
cmd: false,
args: ['mocha'],
rawArgs: ['--colors']
}
},
mocha_istanbul: {
local: {
src: 'test/', // the folder, not the files
options: {
ui: 'bdd',
coverage: true,
recursive: true,
reporter: 'list',
timeout: 20000,
mask: '*Tests.js',
check: {
lines: 60,
statements: 60,
function: 60
},
root: '.', // define where the cover task should consider the root of libraries that are covered by tests
coverageFolder: 'dist/coverage',
reportFormats: ['lcov']
}
},
}
});

grunt.event.on('coverage', function(lcovFileContents, done) {
// Check below
done();
});

grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-license-finder');

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('gruntify-eslint');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-simple-nyc');

// Default task(s).
grunt.registerTask('default', ['eslint:local', 'eslint:tests', 'mocha_istanbul:local']);
grunt.registerTask('packaging', ['compress:teamcity']);
grunt.registerTask('default', ['eslint:local', 'eslint:tests', 'nyc:all']);
};

5 changes: 4 additions & 1 deletion lib/proxies/iot.mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ IoTKitMQTTCloud.prototype.data = function (data, callback) {
delete data.deviceToken;
var topic = common.buildPath(me.topics.metric_topic, [data.accountId, data.did]);
delete data.gatewayId;
return me.client.publish(topic, data.convertToMQTTPayload(), me.pubArgs, function() {
return me.client.publish(topic, data.convertToMQTTPayload(), me.pubArgs, function(err) {
if (err) {
return callback({status:1});
}
return callback({status:0});
});
};
Expand Down
48 changes: 29 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
{
"name": "@open-iot-service-platform/oisp-sdk-js",
"version": "1.0.1",
"version": "1.1.0",
"description": "OISP SDK for Node.js",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "grunt"
},
"author": "",
"license": "ISC",
"repository": {
"type": "git",
"url": "git://github.com/Open-IoT-Service-Platform/oisp-sdk-js.git"
},
"keywords": [
"oisp",
"sdk",
"js"
],
"author": "Intel",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/Open-IoT-Service-Platform/oisp-sdk-js/issues"
},
"homepage": "https://github.com/Open-IoT-Service-Platform/oisp-sdk-js",
"dependencies": {
"async": "^2.6.2",
"borc": "^2.1.0",
"async": "^3.1.0",
"borc": "^2.1.1",
"mqtt" : "^3.0.0",
"request": "^2.88.0",
"tunnel": "0.0.5",
"mqtt" : "^2.13.1",
"websocket": "^1.0.24"
"tunnel": "0.0.6",
"websocket": "^1.0.29"
},
"devDependencies": {
"chai": "^4.1.2",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-compress": "^1.4.3",
"gruntify-eslint": "^4.0.0",
"grunt-license-finder": "^2.0.0",
"grunt-mocha-istanbul": "^5.0.2",
"istanbul": "^0.4.5",
"mocha": "^4.0.1",
"rewire": "^2.5.2"
"chai": "^4.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-simple-nyc": "^3.0.0",
"gruntify-eslint": "^5.0.0",
"mocha": "^6.2.0",
"rewire": "^4.0.1"
}
}
1 change: 0 additions & 1 deletion test/api_iot.devicesTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ describe(fileToTest, function() {
};

var callBack = function (error, response) {
console.log("Marcel: error", error);
assert.isNull(error, "An expected Error is detected");
assert.isArray(response, "The Response were missing");
assert.deepEqual(response[0], reData, "The Data were missing");
Expand Down

0 comments on commit 0f1cbb1

Please sign in to comment.