Skip to content

Commit

Permalink
add tests for it
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 14, 2023
1 parent eef762e commit 59ca120
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ repositories {
dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
implementation "org.xmtp:android:0.5.6"
implementation "org.xmtp:android:0.6.0"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.facebook.react:react-native:0.71.3'
implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class XMTPModule : Module() {
DecryptedLocalAttachment(
fileUri = file.toURI().toString(),
mimeType = attachment.mimeType,
fileName = attachment.filename
filename = attachment.filename
).toJson()
}

Expand Down
3 changes: 3 additions & 0 deletions example/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ test("remote attachments should work", async () => {
if (attached.mimeType !== "text/plain") {
throw new Error("Expected mimeType to match");
}
if (attached.filename !== filename) {
throw new Error(`Expected ${attached.filename} to equal ${filename}`);
}
const text = await fs.readFile(new URL(attached.fileUri).pathname, "utf8");
if (text !== "hello world") {
throw new Error("Expected text to match");
Expand Down

0 comments on commit 59ca120

Please sign in to comment.