/* jshint -W097 */// jshint strict:false
/*jslint node: true */
var expect = require('chai').expect;
var fs        = require('fs');

describe('Test package.json and io-package.json', function() {
    it('Test package files', function (done) {
        var fileContentIOPackage = fs.readFileSync(__dirname + '/../io-package.json');
        var ioPackage = JSON.parse(fileContentIOPackage);

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

        expect(ioPackage).to.be.an('object');
        expect(npmPackage).to.be.an('object');

        expect(ioPackage.common.version).to.exist;
        expect(npmPackage.version).to.exist;

        if (!expect(ioPackage.common.version).to.be.equal(npmPackage.version)) {
            console.log('ERROR: Version numbers in package.json and io-package.json differ!!');
        }

        if (!ioPackage.common.news || !ioPackage.common.news[ioPackage.common.version]) {
            console.log('WARNING: No news entry for current version exists in io-package.json, no rollback in Admin possible!');
        }

        done();
    });
});

@@ -11,18 +11,19 @@
 -W097 */
-//
+%0A/*
  jshint 
@@ -34,19 +34,23 @@
 ct:false
+ */
 %0A/*
+ 
 jslint n
@@ -62,16 +62,40 @@
 true */%0A
+/* jshint expr: true */%0A
 var expe
@@ -1158,32 +1158,738 @@
 !');%0A        %7D%0A%0A
+        expect(ioPackage.common.authors).to.exist;%0A        if (ioPackage.common.name.indexOf('template') !== 0) %7B%0A            if (Array.isArray(ioPackage.common.authors)) %7B%0A                expect(ioPackage.common.authors.length).to.not.be.equal(0);%0A                if (ioPackage.common.authors.length === 1) %7B%0A                    expect(ioPackage.common.authors%5B0%5D).to.not.be.equal('my Name %3Cmy@email.com%3E');%0A                %7D%0A            %7D%0A            else %7B%0A                expect(ioPackage.common.authors).to.not.be.equal('my Name %3Cmy@email.com%3E');%0A            %7D%0A        %7D%0A        else %7B%0A            console.log('Testing for set authors field in io-package skipped because template adapter');%0A        %7D%0A
         done();%0A

update basic package-file testing