0.6.1 • Published 2 years ago
@minepress/minexpect v0.6.1
MinExpect
Assert library made for Minepress
This library is based on retry-and-timeout logic
await new Expect(
this.lastMsg, // Initial Value
(retry) => { // Register Event Handler
// Here the event handler must call the retry method to well
// Retry the check
this.bot?.on("messagestr", retry);
},
(retry) => { // Dispose Event Handler
// This is called after the check has been successful
// it is expected to remove the event handler
this.bot?.removeListener("messagestr", retry)
}).toBe("<Bot> Test")