Skip to content

Commit 830ff79

Browse files
committed
Update test
1 parent f7f939a commit 830ff79

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

test/integration.js

+21-8
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,31 @@ tests.integration(path.join(__dirname, ".."), {
3333
console.log("Starting adapter...");
3434
// Start the adapter and wait until it has started
3535
await harness
36-
.startAdapterAndWait(true)
36+
.startAdapterAndWait()
3737
.then(() => {
3838
console.log("Adapter started");
39-
reject();
39+
//Get state info.connection
40+
harness.states
41+
.getState("gotify.0.info.connection")
42+
.then((state) => {
43+
console.log("State info.connection: " + JSON.stringify(state));
44+
if (state && state.val === true) {
45+
console.log(
46+
"Connection established - should not happen - adapter is not configured",
47+
);
48+
reject();
49+
} else {
50+
resolve();
51+
}
52+
})
53+
.catch((error) => {
54+
console.log("Adapter not started: " + error);
55+
reject();
56+
});
4057
})
4158
.catch((error) => {
42-
if (error.message === "The adapter startup was interrupted unexpectedly with code 2") {
43-
resolve();
44-
} else {
45-
console.error("Error starting adapter: " + error.message);
46-
reject();
47-
}
59+
console.log("Adapter not started: " + error);
60+
reject();
4861
});
4962
});
5063
});

0 commit comments

Comments
 (0)