expo-modules-test-core 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'org.unimodules'
|
|
6
|
-
version = '0.
|
|
6
|
+
version = '0.10.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 3
|
|
77
|
-
versionName '0.
|
|
77
|
+
versionName '0.10.0'
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package expo.modules.test.core
|
|
2
2
|
|
|
3
|
+
import android.os.Bundle
|
|
3
4
|
import expo.modules.kotlin.exception.CodedException
|
|
4
5
|
import org.junit.Assert
|
|
5
6
|
import java.lang.reflect.UndeclaredThrowableException
|
|
@@ -45,3 +46,34 @@ inline fun assertCodedException(exception: Throwable?, block: (exception: CodedE
|
|
|
45
46
|
assertCodedException(exception)
|
|
46
47
|
block(exception)
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
fun assertResolved(promise: PromiseMock) {
|
|
51
|
+
Assert.assertEquals(PromiseState.RESOLVED, promise.state)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fun assertRejected(promise: PromiseMock) {
|
|
55
|
+
Assert.assertEquals(PromiseState.REJECTED, promise.state)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fun promiseResolved(promise: PromiseMock, with: (Bundle) -> Unit) {
|
|
59
|
+
assertResolved(promise)
|
|
60
|
+
with(promise.resolveValue as Bundle)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
inline fun <reified T> promiseResolvedWithType(promise: PromiseMock, with: (T) -> Unit) {
|
|
64
|
+
assertResolved(promise)
|
|
65
|
+
Assert.assertTrue("Promise resolved with incorrect type", promise.resolveValue is T)
|
|
66
|
+
with(promise.resolveValue as T)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
fun promiseRejected(promise: PromiseMock, with: (PromiseMock) -> Unit) {
|
|
70
|
+
assertRejected(promise)
|
|
71
|
+
with(promise)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fun assertRejectedWithCode(promise: PromiseMock, rejectCode: String) {
|
|
75
|
+
promiseRejected(promise) {
|
|
76
|
+
Assert.assertTrue("Promise has no rejection code", it.rejectCodeSet)
|
|
77
|
+
Assert.assertEquals(it.rejectCode, rejectCode)
|
|
78
|
+
}
|
|
79
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-test-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"main": "./app.plugin.js",
|
|
5
5
|
"description": "Module providing native testing utilities for testing Expo modules",
|
|
6
6
|
"keywords": [
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"author": "650 Industries, Inc.",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"homepage": "https://github.com/expo/expo/tree/main/packages/expo-modules-test-core",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "ba80e8181b79d06e00a245653727f4eaeb80420e"
|
|
25
25
|
}
|