Skip to content

Commit 4d1499e

Browse files
committed
add iOS tests
1 parent f3262d5 commit 4d1499e

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under the MIT license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
require "test/unit"
7+
require_relative "../utils.rb"
8+
require_relative "../../../sdks/hermes-engine/hermes-utils.rb"
9+
10+
class MavenCacheFlagTests < Test::Unit::TestCase
11+
def setup
12+
@original_value = ENV['RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED']
13+
ENV.delete('RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED')
14+
end
15+
16+
def teardown
17+
if @original_value == nil
18+
ENV.delete('RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED')
19+
else
20+
ENV['RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED'] = @original_value
21+
end
22+
end
23+
24+
def test_mavenCache_isDisabledByDefault
25+
assert_false(ReactNativePodsUtils.react_native_maven_cache_enabled?)
26+
assert_false(react_native_maven_cache_enabled?)
27+
end
28+
29+
def test_mavenCache_isEnabledWhenExplicitlySetToTrue
30+
ENV['RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED'] = 'true'
31+
32+
assert_true(ReactNativePodsUtils.react_native_maven_cache_enabled?)
33+
assert_true(react_native_maven_cache_enabled?)
34+
end
35+
36+
def test_mavenCache_isDisabledWhenExplicitlySetToFalse
37+
ENV['RCT_REACT_NATIVE_MAVEN_CACHE_ENABLED'] = 'false'
38+
39+
assert_false(ReactNativePodsUtils.react_native_maven_cache_enabled?)
40+
assert_false(react_native_maven_cache_enabled?)
41+
end
42+
end

0 commit comments

Comments
 (0)