Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Nov 6, 2023
1 parent 2c812e3 commit 58498a8
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ const chai = require('chai');
const expect = chai.expect;

async function startAdapterAndWaitForStop(harness) {
return new Promise(resolve => {
harness.startAdapterAndWait()
.then(() => {
// Wait for adapter stop
harness.on('stateChange', async (id, state) => {
if (
id === `system.adapter.${harness.adapterName}.0.alive` &&
state &&
state.val === false
) {
setTimeout(() => {
resolve(true);
}, 2000);
}
});
return new Promise((resolve) => {
harness.startAdapterAndWait().then(() => {
// Wait for adapter stop
harness.on('stateChange', async (id, state) => {
if (id === `system.adapter.${harness.adapterName}.0.alive` && state && state.val === false) {
setTimeout(() => {
resolve(true);
}, 2000);
}
});
});
});
}

Expand All @@ -37,8 +32,7 @@ async function assertStateEquals(harness, id, value) {
tests.integration(path.join(__dirname, '..'), {
allowedExitCodes: [11],
defineAdditionalTests({ suite }) {

suite('Test Birthday calculation', getHarness => {
suite('Test Birthday calculation', (getHarness) => {
/**
* @type {IntegrationTestHarness}
*/
Expand Down Expand Up @@ -77,10 +71,10 @@ tests.integration(path.join(__dirname, '..'), {
day: 32,
month: 1,
year: 1976,
}
},
],
currentAgeTemplate: '%y Jahre, %m Monate und %d Tage',
}
},
});

return startAdapterAndWaitForStop(harness);
Expand All @@ -102,5 +96,5 @@ tests.integration(path.join(__dirname, '..'), {
await assertStateEquals(harness, `${harness.adapterName}.0.month.02.maxMustermann.year`, 2000);
});
});
}
});
},
});

0 comments on commit 58498a8

Please sign in to comment.