NEWS
Integration Test läuft nicht an
-
Ich habe einen Adapter mit dem Template erstellt. Code für den Integration Test integrations.js überschreibe ich mit dem Beispiel aus
https://github.com/ioBroker/testing
Adapter startup (Integration test)Allerdings läuft der Test nicht richtig an, es kommt
0 passing (0ms)Und die Stellen unten wo createErr stht werden offensichtlich nicht ausgeführt.
const path = require("path"); const { tests } = require("@iobroker/testing"); // Run tests tests.integration(path.join(__dirname, ".."), { allowedExitCodes: [11], controllerVersion: "latest", // or a specific version like "4.0.1" // Define your own tests inside defineAdditionalTests defineAdditionalTests({ suite }) { suite("Test sendTo()", (getHarness) => { // For convenience, get the current suite's harness before all tests let harness; before(() => { harness = getHarness(); createErr; }); it("Should work", () => { return new Promise(async (resolve) => { // Start the adapter and wait until it has started createErr; await harness.startAdapterAndWait(); // Perform the actual test: harness.sendTo(".0", "test", "message", (resp) => { createErr; console.dir(resp); resolve(); }); }); }); });
Was muss ich anpassen bzw gibts Beispiele für funktionierende Tests?