Skip to content

Commit

Permalink
Merge pull request #24 from iobroker-community-adapters/master
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
GermanBluefox authored Mar 4, 2019
2 parents a82d908 + d2adb33 commit 661067d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
os:
- linux
- windows
language: node_js
install:
- npm install [email protected]
Expand Down
6 changes: 3 additions & 3 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@
"web"
],
"icon": "habpanel.png",
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.habpanel/master/admin/habpanel.png",
"extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.habpanel/master/admin/habpanel.png",
"keywords": [
"user",
"interface",
"webapp",
"jquerymobile",
"ui"
],
"readme": "https://github.com/ioBroker/ioBroker.habpanel/blob/master/README.md",
"readme": "https://github.com/iobroker-community-adapters/ioBroker.habpanel/blob/master/README.md",
"singleton": true,
"welcomeScreen": {
"link": "habpanel/index.html",
Expand Down Expand Up @@ -183,4 +183,4 @@
"webInstance": "*"
},
"objects": []
}
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"email": "[email protected]"
}
],
"homepage": "https://github.com/ioBroker/ioBroker.habpanel",
"homepage": "https://github.com/iobroker-community-adapters/ioBroker.habpanel",
"repository": {
"type": "git",
"url": "https://github.com/ioBroker/ioBroker.habpanel"
"url": "https://github.com/iobroker-community-adapters/ioBroker.habpanel"
},
"licenses": [
{
"type": "EPL-1.0",
"url": "https://github.com/ioBroker/ioBroker.habpanel/blob/master/LICENSE"
"url": "https://github.com/iobroker-community-adapters/ioBroker.habpanel/blob/master/LICENSE"
}
],
"keywords": [
Expand Down Expand Up @@ -71,19 +71,20 @@
"configstore": "^4.0.0",
"request": "^2.88.0",
"safe-eval": "^0.4.1",
"mocha": "^5.2.0",
"chai": "^4.1.2"
"mocha": "^6.0.2",
"chai": "^4.1.2",
"@iobroker/adapter-core": "^1.0.3"
},
"dependencies": {
"bower": "^1.8.4"
},
"bugs": {
"url": "https://github.com/ioBroker/ioBroker.habpanel/issues"
"url": "https://github.com/iobroker-community-adapters/ioBroker.habpanel/issues"
},
"main": "",
"scripts": {
"test": "node node_modules/mocha/bin/mocha --exit",
"prepublish": "node node_modules/gulp/bin/gulp default"
},
"license": "EPL-1.0"
}
}
26 changes: 15 additions & 11 deletions test/testPackageFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
/* jshint strict:false */
/* jslint node: true */
/* jshint expr: true */
var expect = require('chai').expect;
var fs = require('fs');
'use strict';

describe('Test package.json and io-package.json', function() {
it('Test package files', function (done) {
const expect = require('chai').expect;
const fs = require('fs');

describe('Test package.json and io-package.json', () => {
it('Test package files', done => {
console.log();

var fileContentIOPackage = fs.readFileSync(__dirname + '/../io-package.json', 'utf8');
var ioPackage = JSON.parse(fileContentIOPackage);
const fileContentIOPackage = fs.readFileSync(__dirname + '/../io-package.json', 'utf8');
const ioPackage = JSON.parse(fileContentIOPackage);

var fileContentNPMPackage = fs.readFileSync(__dirname + '/../package.json', 'utf8');
var npmPackage = JSON.parse(fileContentNPMPackage);
const fileContentNPMPackage = fs.readFileSync(__dirname + '/../package.json', 'utf8');
const npmPackage = JSON.parse(fileContentNPMPackage);

expect(ioPackage).to.be.an('object');
expect(npmPackage).to.be.an('object');
Expand All @@ -31,6 +33,8 @@ describe('Test package.json and io-package.json', function() {
expect(npmPackage.author, 'ERROR: Author in package.json needs to exist').to.exist;
expect(ioPackage.common.authors, 'ERROR: Authors in io-package.json needs to exist').to.exist;

expect(ioPackage.common.license, 'ERROR: License missing in io-package in common.license').to.exist;

if (ioPackage.common.name.indexOf('template') !== 0) {
if (Array.isArray(ioPackage.common.authors)) {
expect(ioPackage.common.authors.length, 'ERROR: Author in io-package.json needs to be set').to.not.be.equal(0);
Expand Down Expand Up @@ -61,7 +65,7 @@ describe('Test package.json and io-package.json', function() {
console.log();
}

if (ioPackage.common.name.indexOf('vis-') !== 0) {
if (!ioPackage.common.controller && !ioPackage.common.onlyWWW && !ioPackage.common.noConfig) {
if (!ioPackage.common.materialize || !fs.existsSync(__dirname + '/../admin/index_m.html') || !fs.existsSync(__dirname + '/../gulpfile.js')) {
console.log('WARNING: Admin3 support is missing! Please add it');
console.log();
Expand All @@ -71,8 +75,8 @@ describe('Test package.json and io-package.json', function() {
}
}

var licenseFileExists = fs.existsSync(__dirname + '/../LICENSE');
var fileContentReadme = fs.readFileSync(__dirname + '/../README.md', 'utf8');
const licenseFileExists = fs.existsSync(__dirname + '/../LICENSE');
const fileContentReadme = fs.readFileSync(__dirname + '/../README.md', 'utf8');
if (fileContentReadme.indexOf('## Changelog') === -1) {
console.log('Warning: The README.md should have a section ## Changelog');
console.log();
Expand Down

0 comments on commit 661067d

Please sign in to comment.