@@ -7,55 +7,60 @@ const PACKAGE_ROOT = path.join(__dirname, "../..");
77const MONOREPO_ROOT = path . join ( PACKAGE_ROOT , "../.." ) ;
88const TEST_APP_ANDROID_PATH = path . join ( MONOREPO_ROOT , "apps/test-app/android" ) ;
99
10- describe ( "Gradle tasks" , ( ) => {
11- describe ( "checkHermesOverride task" , ( ) => {
12- it ( "should fail if REACT_NATIVE_OVERRIDE_HERMES_DIR is not set" , ( ) => {
13- const { status, stdout, stderr } = cp . spawnSync (
14- "sh" ,
15- [ "gradlew" , "react-native-node-api:checkHermesOverride" ] ,
16- {
17- cwd : TEST_APP_ANDROID_PATH ,
18- env : {
19- ...process . env ,
20- REACT_NATIVE_OVERRIDE_HERMES_DIR : undefined ,
10+ describe (
11+ "Gradle tasks" ,
12+ // Skipping these tests by default, as they download a lot and takes a long time
13+ { skip : process . env . ENABLE_GRADLE_TESTS !== "true" } ,
14+ ( ) => {
15+ describe ( "checkHermesOverride task" , ( ) => {
16+ it ( "should fail if REACT_NATIVE_OVERRIDE_HERMES_DIR is not set" , ( ) => {
17+ const { status, stdout, stderr } = cp . spawnSync (
18+ "sh" ,
19+ [ "gradlew" , "react-native-node-api:checkHermesOverride" ] ,
20+ {
21+ cwd : TEST_APP_ANDROID_PATH ,
22+ env : {
23+ ...process . env ,
24+ REACT_NATIVE_OVERRIDE_HERMES_DIR : undefined ,
25+ } ,
26+ encoding : "utf-8" ,
2127 } ,
22- encoding : "utf-8" ,
23- } ,
24- ) ;
28+ ) ;
2529
26- assert . notEqual ( status , 0 , `Expected failure: ${ stdout } ${ stderr } ` ) ;
27- assert . match (
28- stderr ,
29- / R e a c t N a t i v e N o d e - A P I n e e d s a c u s t o m v e r s i o n o f H e r m e s w i t h N o d e - A P I e n a b l e d / ,
30- ) ;
31- assert . match (
32- stderr ,
33- / R u n t h e f o l l o w i n g i n y o u r t e r m i n a l , t o c l o n e H e r m e s a n d i n s t r u c t R e a c t N a t i v e t o u s e i t / ,
34- ) ;
35- assert . match (
36- stderr ,
37- / e x p o r t R E A C T _ N A T I V E _ O V E R R I D E _ H E R M E S _ D I R = ` n p x r e a c t - n a t i v e - n o d e - a p i v e n d o r - h e r m e s - - s i l e n t - - f o r c e ` / ,
38- ) ;
39- assert . match (
40- stderr ,
41- / A n d f o l l o w t h i s g u i d e t o b u i l d R e a c t N a t i v e f r o m s o u r c e / ,
42- ) ;
30+ assert . notEqual ( status , 0 , `Expected failure: ${ stdout } ${ stderr } ` ) ;
31+ assert . match (
32+ stderr ,
33+ / R e a c t N a t i v e N o d e - A P I n e e d s a c u s t o m v e r s i o n o f H e r m e s w i t h N o d e - A P I e n a b l e d / ,
34+ ) ;
35+ assert . match (
36+ stderr ,
37+ / R u n t h e f o l l o w i n g i n y o u r t e r m i n a l , t o c l o n e H e r m e s a n d i n s t r u c t R e a c t N a t i v e t o u s e i t / ,
38+ ) ;
39+ assert . match (
40+ stderr ,
41+ / e x p o r t R E A C T _ N A T I V E _ O V E R R I D E _ H E R M E S _ D I R = ` n p x r e a c t - n a t i v e - n o d e - a p i v e n d o r - h e r m e s - - s i l e n t - - f o r c e ` / ,
42+ ) ;
43+ assert . match (
44+ stderr ,
45+ / A n d f o l l o w t h i s g u i d e t o b u i l d R e a c t N a t i v e f r o m s o u r c e / ,
46+ ) ;
47+ } ) ;
4348 } ) ;
44- } ) ;
4549
46- describe ( "linkNodeApiModules task" , ( ) => {
47- it ( "should call the CLI to autolink" , ( ) => {
48- const { status, stdout, stderr } = cp . spawnSync (
49- "sh" ,
50- [ "gradlew" , "react-native-node-api:linkNodeApiModules" ] ,
51- {
52- cwd : TEST_APP_ANDROID_PATH ,
53- encoding : "utf-8" ,
54- } ,
55- ) ;
50+ describe ( "linkNodeApiModules task" , ( ) => {
51+ it ( "should call the CLI to autolink" , ( ) => {
52+ const { status, stdout, stderr } = cp . spawnSync (
53+ "sh" ,
54+ [ "gradlew" , "react-native-node-api:linkNodeApiModules" ] ,
55+ {
56+ cwd : TEST_APP_ANDROID_PATH ,
57+ encoding : "utf-8" ,
58+ } ,
59+ ) ;
5660
57- assert . equal ( status , 0 , `Expected failure: ${ stdout } ${ stderr } ` ) ;
58- assert . match ( stdout , / A u t o - l i n k i n g N o d e - A P I m o d u l e s / ) ;
61+ assert . equal ( status , 0 , `Expected failure: ${ stdout } ${ stderr } ` ) ;
62+ assert . match ( stdout , / A u t o - l i n k i n g N o d e - A P I m o d u l e s / ) ;
63+ } ) ;
5964 } ) ;
60- } ) ;
61- } ) ;
65+ } ,
66+ ) ;
0 commit comments