Skip to content

Commit

Permalink
Merge pull request #49 from xmtp/np/add-more-tests
Browse files Browse the repository at this point in the history
Can Message Test
  • Loading branch information
nplasterer authored Jun 2, 2023
2 parents 3fd91b3 + b9bc6a1 commit 428fffa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.hamcrest.Matcher
import java.util.concurrent.TimeoutException

object EspressoViewFinder {
private const val CHECK_INTERVAL = 50L
private const val TIMEOUT_MS = 15 * 1000L
private const val CHECK_INTERVAL = 150L
private const val TIMEOUT_MS = 30 * 1000L

/**
* Waits for the view referenced in [viewMatcher] to become visible, with a timeout of [timeOut]. If it
Expand Down
10 changes: 9 additions & 1 deletion example/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ test("can message a client", async () => {
const messages = await aliceConversation.messages();

if (messages.length !== 1) {
throw "No message";
throw Error("No message");
}

const message = messages[0];

return message.content === "hello world";
});

test("canMessage", async () => {
const bob = await XMTP.Client.createRandom("local");
const alice = await XMTP.Client.createRandom("local");

const canMessage = await bob.canMessage(alice.address);
return canMessage;
});

0 comments on commit 428fffa

Please sign in to comment.