File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,27 @@ Starting with Android 9 (API level 28) you need to explicitly allow cleartext tr
5757```
5858
5959Reference: https://developer.android.com/training/articles/security-config
60+
61+ ## How to run unit tests in Android Studio?
62+
63+ Local unit tests are tests that run on your machine's local Java Virtual Machine.
64+
65+ Reference: https://developer.android.com/studio/test/test-in-android-studio
66+
67+ Since they run on your machine, the JSON library must be manually included for the tests (because it is not provided by the Android runtime):
68+
69+ ` build.gradle `
70+
71+ ```
72+ dependencies {
73+ implementation ('io.socket:socket.io-client:2.0.1') {
74+ exclude group: 'org.json', module: 'json'
75+ }
76+
77+ testImplementation 'org.json:json:20090211'
78+
79+ ...
80+ }
81+ ```
82+
83+ Note: we use this ancient version of ` org.json ` because it is compatible with the one bundled in Android.
You can’t perform that action at this time.
0 commit comments