Skip to content

Migrate ioBroker.ping tests to @iobroker/testing library#327

Draft
Copilot wants to merge 1 commit intoclaude/migrate-to-iobroker-testing-01NKixFWwBLHiLWPbFXDzeQmfrom
copilot/sub-pr-275
Draft

Migrate ioBroker.ping tests to @iobroker/testing library#327
Copilot wants to merge 1 commit intoclaude/migrate-to-iobroker-testing-01NKixFWwBLHiLWPbFXDzeQmfrom
copilot/sub-pr-275

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

The existing integration tests were not using the @iobroker/testing harness and failed in sandboxed/Docker environments where the ping binary is unavailable.

Changes

test/integration.js

  • Restructured into three focused suites using tests.integration + defineAdditionalTests:
    • startup and state creation – adapter starts, correct objects created
    • state values – localhost always tested; google.com and unreachable-IP checks gated on process.env.CI
    • GUI – Puppeteer browser test, opt-in via TEST_GUI=1

test/unit.js

  • Regular ping test now skips gracefully on ENOENT (ping binary absent in restricted environments)
ping.probe('127.0.0.1', { log: () => {}, minReply: 1 }, (err, result) => {
    if (err && err.message && err.message.includes('ENOENT')) {
        this.skip();
        return;
    }
    expect(result.alive).to.be.true;
});

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Migrate iobroker.ping tests to @iobroker/testing library Migrate ioBroker.ping tests to @iobroker/testing library Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants