-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to wait for adapter stop? #507
Comments
It would be awesome if the test lib provides a function with a promise which waits for stop and checks the allowed exist codes to resolve the promise. Like harness.startAdapterAndWaitForStop()
.then(exitCode => {
// ...
}); |
I don't think this was a use case before, so it wasn't considered yet. Currently a suite essentially ends when the adapter stops. |
I've migrated some testing logic to the integration tests for iCal. See https://github.com/iobroker-community-adapters/ioBroker.ical/blob/062b64f3555f40fb0c523f260ae126e0c2cf0759/test/integration.js But I don't know if this is the best way to do it. At the moment the adapter is started with given settings in the "before" section and returns a promise which will be resolved when the adapter has been stopped. After that, all states can be checked. |
This expect(harness.isAdapterRunning()).to.be.true;
expect(harness.isControllerRunning()).to.be.true; is unnecessary IMO, since The rest with the waiting looks like a viable workaround, although it is a bit awkward. I'll look into making this feel more "natural". |
That was the reason for this issue 😄 Thanks a lot! |
I have a schedule adapter and I want to perform some checks when everything is finished (based on adapter configuration). What is the best way to wait for the adapter to stop?
Something like this?
The text was updated successfully, but these errors were encountered: