@@ -55,31 +55,39 @@ describe("isBridgelessEnabled()", () => {
55
55
} ) ;
56
56
57
57
describe ( "isHermesEnabled()" , ( ) => {
58
- before ( ( ) => {
58
+ function resetEnvironmentVariables ( ) {
59
59
delete process . env [ "USE_HERMES" ] ;
60
- } ) ;
60
+ }
61
61
62
- afterEach ( ( ) => {
63
- delete process . env [ "USE_HERMES" ] ;
64
- } ) ;
62
+ before ( resetEnvironmentVariables ) ;
63
+
64
+ afterEach ( resetEnvironmentVariables ) ;
65
65
66
66
for ( const platform of [ "ios" , "macos" , "visionos" ] as const ) {
67
67
it ( `[${ platform } ] is disabled by default` , ( ) => {
68
- ok ( ! isHermesEnabled ( platform , v ( 1 , 0 , 0 ) , { } ) ) ;
68
+ ok ( ! isHermesEnabled ( platform , v ( 0 , 79 , 0 ) , { } ) ) ;
69
69
} ) ;
70
70
71
71
it ( `[${ platform } ] returns true when enabled` , ( ) => {
72
- ok ( isHermesEnabled ( platform , v ( 1 , 0 , 0 ) , { hermesEnabled : true } ) ) ;
72
+ ok ( isHermesEnabled ( platform , v ( 0 , 79 , 0 ) , { hermesEnabled : true } ) ) ;
73
73
} ) ;
74
74
75
75
it ( `[${ platform } ] returns true if 'USE_HERMES=1'` , ( ) => {
76
76
process . env [ "USE_HERMES" ] = "1" ;
77
- ok ( isHermesEnabled ( platform , v ( 1 , 0 , 0 ) , { } ) ) ;
77
+ ok ( isHermesEnabled ( platform , v ( 0 , 79 , 0 ) , { } ) ) ;
78
78
} ) ;
79
79
80
80
it ( `[${ platform } ] returns false if 'USE_HERMES=0'` , ( ) => {
81
81
process . env [ "USE_HERMES" ] = "0" ;
82
- ok ( ! isHermesEnabled ( platform , v ( 1 , 0 , 0 ) , { hermesEnabled : true } ) ) ;
82
+ ok ( ! isHermesEnabled ( platform , v ( 0 , 79 , 0 ) , { hermesEnabled : true } ) ) ;
83
+ } ) ;
84
+
85
+ it ( `[${ platform } ] always returns true from 0.80 on` , ( ) => {
86
+ ok ( isHermesEnabled ( platform , v ( 0 , 80 , 0 ) , { } ) ) ;
87
+
88
+ process . env [ "USE_HERMES" ] = "0" ;
89
+
90
+ ok ( isHermesEnabled ( platform , v ( 0 , 80 , 0 ) , { } ) ) ;
83
91
} ) ;
84
92
}
85
93
0 commit comments