-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from xmtp/cv/adding-tests-easier
Modal for selecting subset of tests
- Loading branch information
Showing
7 changed files
with
87 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Platform } from 'expo-modules-core' | ||
import { Client } from 'xmtp-react-native-sdk' | ||
|
||
export type Test = { | ||
name: string | ||
run: () => Promise<boolean> | ||
} | ||
|
||
export function isIos() { | ||
return Platform.OS === 'ios' | ||
} | ||
|
||
export async function delayToPropogate(milliseconds = 100): Promise<void> { | ||
// delay avoid clobbering | ||
return new Promise((r) => setTimeout(r, milliseconds)) | ||
} | ||
|
||
export function assert(condition: boolean, msg: string) { | ||
if (!condition) { | ||
throw new Error(msg) | ||
} | ||
} | ||
|
||
export async function createClients( | ||
numClients: number | ||
): Promise<Client<any>[]> { | ||
const clients = [] | ||
for (let i = 0; i < numClients; i++) { | ||
clients.push( | ||
await Client.createRandom({ | ||
env: 'local', | ||
enableAlphaMls: true, | ||
}) | ||
) | ||
} | ||
return clients | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters