Skip to content

Commit

Permalink
Revert "change "useIstanbul" handling"
Browse files Browse the repository at this point in the history
This reverts commit 7880a36.
  • Loading branch information
Apollon77 committed Jan 15, 2018
1 parent 775d47d commit 888e2ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 6 additions & 10 deletions test/lib/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pkg.main = pkg.main || 'main.js';
var adapterName = path.normalize(rootDir).replace(/\\/g, '/').split('/');
adapterName = adapterName[adapterName.length - 2];
var adapterStarted = false;
var useIstanbul = false;

function getAppName() {
var parts = __dirname.replace(/\\/g, '/').split('/');
Expand Down Expand Up @@ -450,10 +451,7 @@ function setupController(cb) {
});
}

function startAdapter(objects, states, callback, useIstanbul) {
if (useIstanbul === undefined) {
useIstanbul = false;
}
function startAdapter(objects, states, callback) {
if (adapterStarted) {
console.log('Adapter already started ...');
if (callback) callback(objects, states);
Expand Down Expand Up @@ -501,7 +499,7 @@ function startAdapter(objects, states, callback, useIstanbul) {
if (callback) callback(objects, states);
}

function startController(isStartAdapter, onObjectChange, onStateChange, callback, useIstanbul) {
function startController(isStartAdapter, onObjectChange, onStateChange, callback) {
if (typeof isStartAdapter === 'function') {
callback = onStateChange;
onStateChange = onObjectChange;
Expand All @@ -513,9 +511,6 @@ function startController(isStartAdapter, onObjectChange, onStateChange, callback
callback = onObjectChange;
onObjectChange = undefined;
}
if (useIstanbul === undefined) {
useIstanbul = false;
}

if (pid) {
console.error('Controller is already started!');
Expand Down Expand Up @@ -558,7 +553,7 @@ function startController(isStartAdapter, onObjectChange, onStateChange, callback
if (isStatesConnected) {
console.log('startController: started!');
if (isStartAdapter) {
startAdapter(objects, states, callback, useIstanbul);
startAdapter(objects, states, callback);
} else {
if (callback) callback(objects, states);
}
Expand Down Expand Up @@ -600,7 +595,7 @@ function startController(isStartAdapter, onObjectChange, onStateChange, callback
isStatesConnected = true;
if (isObjectConnected) {
console.log('startController: started!!');
startAdapter(objects, states, callback, useIstanbul);
startAdapter(objects, states, callback);
}
},
change: onStateChange
Expand Down Expand Up @@ -715,4 +710,5 @@ if (typeof module !== undefined && module.parent) {
module.exports.appName = appName;
module.exports.adapterName = adapterName;
module.exports.adapterStarted = adapterStarted;
module.exports.useIstanbul = useIstanbul;
}
3 changes: 2 additions & 1 deletion test/testAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ describe('Test ' + adapterShortName + ' adapter', function() {
before('Test ' + adapterShortName + ' adapter: Start js-controller', function (_done) {
this.timeout(600000); // because of first install from npm

setup.useIstanbul = true;
setup.setupController(function () {
var config = setup.getAdapterConfig();
// enable adapter
Expand All @@ -158,7 +159,7 @@ describe('Test ' + adapterShortName + ' adapter', function() {
objects = _objects;
states = _states;
_done();
}, true);
});
});
});
});
Expand Down

0 comments on commit 888e2ba

Please sign in to comment.