How to use the @iobroker/testing.tests.integration function in @iobroker/testing

To help you get started, we’ve selected a few @iobroker/testing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ioBroker / ioBroker.hm-rega / test / integrationAdapter.js View on Github external
'use strict';

const path = require('path');
const {tests} = require('@iobroker/testing');

// Run tests
tests.integration(path.join(__dirname, '..'), {

    defineAdditionalTests(getHarness) {

        describe('Test sendTo()', () => {

            it('Should work', () => {
                return new Promise(resolve => {
                    // Create a fresh harness instance each test!
                    const harness = getHarness();
                    // Start the adapter and wait until it has started
                    harness.startAdapterAndWait().then(() => {

                        harness.sendTo('hm-rega.0', 'test', 'message', (resp) => {
                            console.dir(resp);
                            resolve();
                        });
github ioBroker / ioBroker.hm-rpc / test / integrationAdapter.js View on Github external
'use strict';

const path = require('path');
const {tests} = require('@iobroker/testing');

// Run tests
tests.integration(path.join(__dirname, '..'), {
    defineAdditionalTests(getHarness) {

        describe('Test sendTo()', () => {
            it('Should work', () => {
                return new Promise(resolve => {
                    // Create a fresh harness instance each test!
                    const harness = getHarness();
                    // Start the adapter and wait until it has started
                    harness.startAdapterAndWait().then(() => {

                        harness.sendTo('hm-rpc.0', 'test', 'message', (resp) => {
                            console.dir(resp);
                            resolve();
                        });
                    });
                });
github Zefau / ioBroker.hue-extended / test / integration.js View on Github external
const path = require('path');
const { tests } = require('@iobroker/testing');

// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options
tests.integration(path.join(__dirname, '..'), { "allowedExitCodes": [11] });
github Zefau / ioBroker.roomba / test / integration.js View on Github external
const path = require('path');
const { tests } = require('@iobroker/testing');

// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options
tests.integration(path.join(__dirname, '..'), { "allowedExitCodes": [11] });

@iobroker/testing

Shared utilities for adapter and module testing in ioBroker

MIT
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis