Skip to content
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

Added instructions for running local xmtp server/unit tests locally #173

Merged
merged 8 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Access the `xmtp-react-native` client SDK [reference documentation](https://xmtp

## Example app

Use the [XMTP React Native example app](example) as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.
Use the [XMTP React Native example app](example) as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with. [See example/README.md](example/README.md) for more instructions.

Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment.
### Quickstart to use the example app:

To use the example app, run:
Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment.

```bash
npm install
cd example
npm install --force
npm run [ios or android]
Expand Down
37 changes: 37 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# XMTP React Native Example App
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved

This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.

## Running the Example App
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved
Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment.

To use the example app, run:

```bash
npm install
cd example
npm install --force
npm run [ios or android]
```

## Running Example App Unit tests on local emulators
alexrisch marked this conversation as resolved.
Show resolved Hide resolved
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved
Running tests locally is useful when updating GitHub actions, or locally testing between changes.

1. [Install docker](https://docs.docker.com/get-docker/)
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved

2. Start a local XMTP server (from example directory)
```bash
docker-compose -p xmtp -f dev/local/docker-compose.yml up -d
```
3. Verify XMTP server is running
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved
```bash
docker-compose ls
NAME STATUS CONFIG FILES
xmtp running(3) <REPO_DIRECTORY>/xmtp-react-native/example/dev/local/docker-compose.yml
```
4. You can now run Unit tests on your local emulators
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved
5. You can stop the local xmtp server with the following command
cameronvoell marked this conversation as resolved.
Show resolved Hide resolved
```bash
docker-compose -p xmtp -f dev/local/docker-compose.yml down
```
Loading