From 9c9ec796709f4482678504420a495257901d5694 Mon Sep 17 00:00:00 2001 From: Hyo Date: Thu, 12 Nov 2020 07:28:22 +0900 Subject: [PATCH] Upgrade react-native to 0.63.0 (#155) Latest i18n-js version. --- .ncurc.json | 1 - babel.config.js | 5 - index.js | 1 + ios/Podfile | 58 +- ios/Podfile.lock | 531 +- ios/dooboo.xcodeproj/project.pbxproj | 38 + jest.config.js | 4 +- package.json | 69 +- src/apis/__tests__/sample.test.ts | 8 +- src/apis/sample.ts | 1 + .../navigation/RootStackNavigator.tsx | 3 + .../__tests__/RootStackNavigator.test.tsx | 5 + .../RootStackNavigator.test.tsx.snap | 23 +- src/components/screen/Intro.tsx | 4 +- src/components/screen/Temp.tsx | 1 + .../screen/__tests__/Intro.test.tsx | 28 +- src/components/screen/__tests__/Temp.test.tsx | 18 +- .../__snapshots__/Intro.test.tsx.snap | 1058 ++-- .../__snapshots__/Temp.test.tsx.snap | 176 +- src/components/shared/Button.tsx | 2 + .../shared/__tests__/Button.test.tsx | 7 + src/providers/AppProvider.tsx | 1 + src/providers/__tests__/AppProvider.test.tsx | 6 + .../__snapshots__/AppProvider.test.tsx.snap | 60 +- src/utils/Styles.ts | 1 + src/utils/createCtx.ts | 5 + test/jestSetup.ts | 7 +- yarn.lock | 5551 +++++++---------- 28 files changed, 3175 insertions(+), 4497 deletions(-) diff --git a/.ncurc.json b/.ncurc.json index 75af81c0..8f8209d0 100644 --- a/.ncurc.json +++ b/.ncurc.json @@ -1,5 +1,4 @@ { - "upgrade": true, "reject": [ "react", "react-dom", diff --git a/babel.config.js b/babel.config.js index b7eb47f7..7f36c258 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,9 +3,4 @@ module.exports = { 'module:metro-react-native-babel-preset', '@babel/preset-typescript', ], - sourceMaps: 'inline', - plugins: [ - '@babel/proposal-class-properties', - '@babel/proposal-object-rest-spread', - ], }; diff --git a/index.js b/index.js index bb86f3ea..a4648096 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ import { AppRegistry, YellowBox } from 'react-native'; + import App from './src/App'; /** diff --git a/ios/Podfile b/ios/Podfile index 6912cc87..1f61546d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,71 +1,23 @@ -platform :ios, '9.0' +require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -def add_flipper_pods! - version = '~> 0.33.1' - pod 'FlipperKit', version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug' - pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug' -end - -# Post Install processing for Flipper -def flipper_post_install(installer) - installer.pods_project.targets.each do |target| - if target.name == 'YogaKit' - target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '4.1' - end - end - end -end +platform :ios, '10.0' target 'dooboo' do - # Pods for dooboo - pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" - pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" - pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" - pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" - pod 'React', :path => '../node_modules/react-native/' - pod 'React-Core', :path => '../node_modules/react-native/' - pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' - pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' - pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' - pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' - pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' - pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' - pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' - pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' - pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' - pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' - pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' - pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' - - pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' - pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' - pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' - pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' - pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon" - pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" - pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true + config = use_native_modules! - pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' - pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' - pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' + use_react_native!(:path => config["reactNativePath"]) target 'doobooTests' do inherit! :complete # Pods for testing end - use_native_modules! - # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. - add_flipper_pods! + use_flipper! post_install do |installer| flipper_post_install(installer) end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3de8137e..9ac9553b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3,19 +3,19 @@ PODS: - CocoaAsyncSocket (7.6.4) - CocoaLibEvent (1.0.0) - DoubleConversion (1.1.6) - - FBLazyVector (0.62.2) - - FBReactNativeSpec (0.62.2): - - Folly (= 2018.10.22.00) - - RCTRequired (= 0.62.2) - - RCTTypeSafety (= 0.62.2) - - React-Core (= 0.62.2) - - React-jsi (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - Flipper (0.33.1): - - Flipper-Folly (~> 2.1) - - Flipper-RSocket (~> 1.0) + - FBLazyVector (0.63.2) + - FBReactNativeSpec (0.63.2): + - Folly (= 2020.01.13.00) + - RCTRequired (= 0.63.2) + - RCTTypeSafety (= 0.63.2) + - React-Core (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - Flipper (0.41.5): + - Flipper-Folly (~> 2.2) + - Flipper-RSocket (~> 1.1) - Flipper-DoubleConversion (1.1.7) - - Flipper-Folly (2.1.1): + - Flipper-Folly (2.2.0): - boost-for-react-native - CocoaLibEvent (~> 1.0) - Flipper-DoubleConversion @@ -23,46 +23,46 @@ PODS: - OpenSSL-Universal (= 1.0.2.19) - Flipper-Glog (0.3.6) - Flipper-PeerTalk (0.0.4) - - Flipper-RSocket (1.0.0): - - Flipper-Folly (~> 2.0) - - FlipperKit (0.33.1): - - FlipperKit/Core (= 0.33.1) - - FlipperKit/Core (0.33.1): - - Flipper (~> 0.33.1) + - Flipper-RSocket (1.1.0): + - Flipper-Folly (~> 2.2) + - FlipperKit (0.41.5): + - FlipperKit/Core (= 0.41.5) + - FlipperKit/Core (0.41.5): + - Flipper (~> 0.41.5) - FlipperKit/CppBridge - FlipperKit/FBCxxFollyDynamicConvert - FlipperKit/FBDefines - FlipperKit/FKPortForwarding - - FlipperKit/CppBridge (0.33.1): - - Flipper (~> 0.33.1) - - FlipperKit/FBCxxFollyDynamicConvert (0.33.1): - - Flipper-Folly (~> 2.1) - - FlipperKit/FBDefines (0.33.1) - - FlipperKit/FKPortForwarding (0.33.1): + - FlipperKit/CppBridge (0.41.5): + - Flipper (~> 0.41.5) + - FlipperKit/FBCxxFollyDynamicConvert (0.41.5): + - Flipper-Folly (~> 2.2) + - FlipperKit/FBDefines (0.41.5) + - FlipperKit/FKPortForwarding (0.41.5): - CocoaAsyncSocket (~> 7.6) - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (0.33.1): + - FlipperKit/FlipperKitHighlightOverlay (0.41.5) + - FlipperKit/FlipperKitLayoutPlugin (0.41.5): - FlipperKit/Core - FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitLayoutTextSearchable - YogaKit (~> 1.18) - - FlipperKit/FlipperKitLayoutTextSearchable (0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (0.33.1): + - FlipperKit/FlipperKitLayoutTextSearchable (0.41.5) + - FlipperKit/FlipperKitNetworkPlugin (0.41.5): - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.33.1): + - FlipperKit/FlipperKitReactPlugin (0.41.5): - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.33.1): + - FlipperKit/FlipperKitUserDefaultsPlugin (0.41.5): - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.33.1): + - FlipperKit/SKIOSNetworkPlugin (0.41.5): - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - - Folly (2018.10.22.00): + - Folly (2020.01.13.00): - boost-for-react-native - DoubleConversion - - Folly/Default (= 2018.10.22.00) + - Folly/Default (= 2020.01.13.00) - glog - - Folly/Default (2018.10.22.00): + - Folly/Default (2020.01.13.00): - boost-for-react-native - DoubleConversion - glog @@ -70,241 +70,245 @@ PODS: - OpenSSL-Universal (1.0.2.19): - OpenSSL-Universal/Static (= 1.0.2.19) - OpenSSL-Universal/Static (1.0.2.19) - - RCTRequired (0.62.2) - - RCTTypeSafety (0.62.2): - - FBLazyVector (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTRequired (= 0.62.2) - - React-Core (= 0.62.2) - - React (0.62.2): - - React-Core (= 0.62.2) - - React-Core/DevSupport (= 0.62.2) - - React-Core/RCTWebSocket (= 0.62.2) - - React-RCTActionSheet (= 0.62.2) - - React-RCTAnimation (= 0.62.2) - - React-RCTBlob (= 0.62.2) - - React-RCTImage (= 0.62.2) - - React-RCTLinking (= 0.62.2) - - React-RCTNetwork (= 0.62.2) - - React-RCTSettings (= 0.62.2) - - React-RCTText (= 0.62.2) - - React-RCTVibration (= 0.62.2) - - React-Core (0.62.2): - - Folly (= 2018.10.22.00) + - RCTRequired (0.63.2) + - RCTTypeSafety (0.63.2): + - FBLazyVector (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTRequired (= 0.63.2) + - React-Core (= 0.63.2) + - React (0.63.2): + - React-Core (= 0.63.2) + - React-Core/DevSupport (= 0.63.2) + - React-Core/RCTWebSocket (= 0.63.2) + - React-RCTActionSheet (= 0.63.2) + - React-RCTAnimation (= 0.63.2) + - React-RCTBlob (= 0.63.2) + - React-RCTImage (= 0.63.2) + - React-RCTLinking (= 0.63.2) + - React-RCTNetwork (= 0.63.2) + - React-RCTSettings (= 0.63.2) + - React-RCTText (= 0.63.2) + - React-RCTVibration (= 0.63.2) + - React-callinvoker (0.63.2) + - React-Core (0.63.2): + - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.62.2) - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-Core/Default (= 0.63.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/CoreModulesHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/CoreModulesHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/Default (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/Default (0.63.2): + - Folly (= 2020.01.13.00) - glog - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/DevSupport (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/DevSupport (0.63.2): + - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.62.2) - - React-Core/RCTWebSocket (= 0.62.2) - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) - - React-jsinspector (= 0.62.2) + - React-Core/Default (= 0.63.2) + - React-Core/RCTWebSocket (= 0.63.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) + - React-jsinspector (= 0.63.2) - Yoga - - React-Core/RCTActionSheetHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTActionSheetHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTAnimationHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTAnimationHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTBlobHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTBlobHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTImageHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTImageHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTLinkingHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTLinkingHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTNetworkHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTNetworkHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTSettingsHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTSettingsHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTTextHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTTextHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTVibrationHeaders (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTVibrationHeaders (0.63.2): + - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-Core/RCTWebSocket (0.62.2): - - Folly (= 2018.10.22.00) + - React-Core/RCTWebSocket (0.63.2): + - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.62.2) - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsiexecutor (= 0.62.2) + - React-Core/Default (= 0.63.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsiexecutor (= 0.63.2) - Yoga - - React-CoreModules (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTTypeSafety (= 0.62.2) - - React-Core/CoreModulesHeaders (= 0.62.2) - - React-RCTImage (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-cxxreact (0.62.2): + - React-CoreModules (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.63.2) + - React-Core/CoreModulesHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - React-RCTImage (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-cxxreact (0.63.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2018.10.22.00) + - Folly (= 2020.01.13.00) - glog - - React-jsinspector (= 0.62.2) - - React-jsi (0.62.2): + - React-callinvoker (= 0.63.2) + - React-jsinspector (= 0.63.2) + - React-jsi (0.63.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2018.10.22.00) + - Folly (= 2020.01.13.00) - glog - - React-jsi/Default (= 0.62.2) - - React-jsi/Default (0.62.2): + - React-jsi/Default (= 0.63.2) + - React-jsi/Default (0.63.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2018.10.22.00) + - Folly (= 2020.01.13.00) - glog - - React-jsiexecutor (0.62.2): + - React-jsiexecutor (0.63.2): - DoubleConversion - - Folly (= 2018.10.22.00) + - Folly (= 2020.01.13.00) - glog - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - React-jsinspector (0.62.2) - - react-native-safe-area-context (2.0.2): - - React - - React-RCTActionSheet (0.62.2): - - React-Core/RCTActionSheetHeaders (= 0.62.2) - - React-RCTAnimation (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTTypeSafety (= 0.62.2) - - React-Core/RCTAnimationHeaders (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTBlob (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - React-Core/RCTBlobHeaders (= 0.62.2) - - React-Core/RCTWebSocket (= 0.62.2) - - React-jsi (= 0.62.2) - - React-RCTNetwork (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTImage (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTTypeSafety (= 0.62.2) - - React-Core/RCTImageHeaders (= 0.62.2) - - React-RCTNetwork (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTLinking (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - React-Core/RCTLinkingHeaders (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTNetwork (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTTypeSafety (= 0.62.2) - - React-Core/RCTNetworkHeaders (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTSettings (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - RCTTypeSafety (= 0.62.2) - - React-Core/RCTSettingsHeaders (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - React-RCTText (0.62.2): - - React-Core/RCTTextHeaders (= 0.62.2) - - React-RCTVibration (0.62.2): - - FBReactNativeSpec (= 0.62.2) - - Folly (= 2018.10.22.00) - - React-Core/RCTVibrationHeaders (= 0.62.2) - - ReactCommon/turbomodule/core (= 0.62.2) - - ReactCommon/callinvoker (0.62.2): - - DoubleConversion - - Folly (= 2018.10.22.00) - - glog - - React-cxxreact (= 0.62.2) - - ReactCommon/turbomodule/core (0.62.2): + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - React-jsinspector (0.63.2) + - react-native-safe-area-context (3.1.8): + - React-Core + - React-RCTActionSheet (0.63.2): + - React-Core/RCTActionSheetHeaders (= 0.63.2) + - React-RCTAnimation (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.63.2) + - React-Core/RCTAnimationHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTBlob (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - React-Core/RCTBlobHeaders (= 0.63.2) + - React-Core/RCTWebSocket (= 0.63.2) + - React-jsi (= 0.63.2) + - React-RCTNetwork (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTImage (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.63.2) + - React-Core/RCTImageHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - React-RCTNetwork (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTLinking (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - React-Core/RCTLinkingHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTNetwork (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.63.2) + - React-Core/RCTNetworkHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTSettings (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.63.2) + - React-Core/RCTSettingsHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - React-RCTText (0.63.2): + - React-Core/RCTTextHeaders (= 0.63.2) + - React-RCTVibration (0.63.2): + - FBReactNativeSpec (= 0.63.2) + - Folly (= 2020.01.13.00) + - React-Core/RCTVibrationHeaders (= 0.63.2) + - React-jsi (= 0.63.2) + - ReactCommon/turbomodule/core (= 0.63.2) + - ReactCommon/turbomodule/core (0.63.2): - DoubleConversion - - Folly (= 2018.10.22.00) + - Folly (= 2020.01.13.00) - glog - - React-Core (= 0.62.2) - - React-cxxreact (= 0.62.2) - - React-jsi (= 0.62.2) - - ReactCommon/callinvoker (= 0.62.2) - - RNCAsyncStorage (1.11.0): + - React-callinvoker (= 0.63.2) + - React-Core (= 0.63.2) + - React-cxxreact (= 0.63.2) + - React-jsi (= 0.63.2) + - RNCAsyncStorage (1.12.0): - React - RNCMaskedView (0.1.10): - React - - RNGestureHandler (1.6.1): + - RNGestureHandler (1.8.0): - React - - RNLocalize (1.4.0): + - RNLocalize (1.4.1): - React - - RNReanimated (1.9.0): + - RNReanimated (1.13.1): - React - - RNScreens (2.8.0): + - RNScreens (2.11.0): - React - Yoga (1.14.0) - YogaKit (1.18.1): @@ -314,16 +318,31 @@ DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) - - FlipperKit (~> 0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (~> 0.33.1) - - FlipperKit/FlipperKitReactPlugin (~> 0.33.1) - - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.33.1) - - FlipperKit/SKIOSNetworkPlugin (~> 0.33.1) + - Flipper (~> 0.41.1) + - Flipper-DoubleConversion (= 1.1.7) + - Flipper-Folly (~> 2.2) + - Flipper-Glog (= 0.3.6) + - Flipper-PeerTalk (~> 0.0.4) + - Flipper-RSocket (~> 1.1) + - FlipperKit (~> 0.41.1) + - FlipperKit/Core (~> 0.41.1) + - FlipperKit/CppBridge (~> 0.41.1) + - FlipperKit/FBCxxFollyDynamicConvert (~> 0.41.1) + - FlipperKit/FBDefines (~> 0.41.1) + - FlipperKit/FKPortForwarding (~> 0.41.1) + - FlipperKit/FlipperKitHighlightOverlay (~> 0.41.1) + - FlipperKit/FlipperKitLayoutPlugin (~> 0.41.1) + - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.41.1) + - FlipperKit/FlipperKitNetworkPlugin (~> 0.41.1) + - FlipperKit/FlipperKitReactPlugin (~> 0.41.1) + - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1) + - FlipperKit/SKIOSNetworkPlugin (~> 0.41.1) - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - React (from `../node_modules/react-native/`) + - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) - React-Core (from `../node_modules/react-native/`) - React-Core/DevSupport (from `../node_modules/react-native/`) - React-Core/RCTWebSocket (from `../node_modules/react-native/`) @@ -342,7 +361,6 @@ DEPENDENCIES: - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - - ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)" - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)" @@ -384,6 +402,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/TypeSafety" React: :path: "../node_modules/react-native/" + React-callinvoker: + :path: "../node_modules/react-native/ReactCommon/callinvoker" React-Core: :path: "../node_modules/react-native/" React-CoreModules: @@ -437,48 +457,49 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f - DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 - FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245 - FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e - Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69 + DoubleConversion: cde416483dac037923206447da6e1454df403714 + FBLazyVector: 3ef4a7f62e7db01092f9d517d2ebc0d0677c4a37 + FBReactNativeSpec: dc7fa9088f0f2a998503a352b0554d69a4391c5a + Flipper: 33585e2d9810fe5528346be33bcf71b37bb7ae13 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 - Flipper-Folly: 2de3d03e0acc7064d5e4ed9f730e2f217486f162 + Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - Flipper-RSocket: 1260a31c05c238eabfa9bb8a64e3983049048371 - FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e - Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 - glog: 1f3da668190260b06b429bb211bfbee5cd790c28 + Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 + FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83 + Folly: b73c3869541e86821df3c387eb0af5f65addfab4 + glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035 - RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce - React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3 - React-Core: b12bffb3f567fdf99510acb716ef1abd426e0e05 - React-CoreModules: 4a9b87bbe669d6c3173c0132c3328e3b000783d0 - React-cxxreact: e65f9c2ba0ac5be946f53548c1aaaee5873a8103 - React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161 - React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da - React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493 - react-native-safe-area-context: 3cecc12a70698e46b5357f04c7cc8826ef7422e1 - React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c - React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0 - React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71 - React-RCTImage: e70be9b9c74fe4e42d0005f42cace7981c994ac3 - React-RCTLinking: c1b9739a88d56ecbec23b7f63650e44672ab2ad2 - React-RCTNetwork: 73138b6f45e5a2768ad93f3d57873c2a18d14b44 - React-RCTSettings: 6e3738a87e21b39a8cb08d627e68c44acf1e325a - React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d - React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256 - ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3 - RNCAsyncStorage: d059c3ee71738c39834a627476322a5a8cd5bf36 + RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe + RCTTypeSafety: 44982c5c8e43ff4141eb519a8ddc88059acd1f3a + React: e1c65dd41cb9db13b99f24608e47dd595f28ca9a + React-callinvoker: 552a6a6bc8b3bb794cf108ad59e5a9e2e3b4fc98 + React-Core: 9d341e725dc9cd2f49e4c49ad1fc4e8776aa2639 + React-CoreModules: 5335e168165da7f7083ce7147768d36d3e292318 + React-cxxreact: d3261ec5f7d11743fbf21e263a34ea51d1f13ebc + React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8 + React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38 + React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606 + react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937 + React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5 + React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6 + React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13 + React-RCTImage: de355d738727b09ad3692f2a979affbd54b5f378 + React-RCTLinking: 8122f221d395a63364b2c0078ce284214bd04575 + React-RCTNetwork: 8f96c7b49ea6a0f28f98258f347b6ad218bc0830 + React-RCTSettings: 8a49622aff9c1925f5455fa340b6fe4853d64ab6 + React-RCTText: 1b6773e776e4b33f90468c20fe3b16ca3e224bb8 + React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d + ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce + RNCAsyncStorage: 2a692bcb9b69b76a2f1a95f33db057129700af64 RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f - RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38 - RNLocalize: b6df30cc25ae736d37874f9bce13351db2f56796 - RNReanimated: b5ccb50650ba06f6e749c7c329a1bc3ae0c88b43 - RNScreens: 62211832af51e0aebcf6e8c36bcf7dd65592f244 - Yoga: 3ebccbdd559724312790e7742142d062476b698e + RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39 + RNLocalize: 49634a6a605dcdeb319e9c42a5c2f1aec508694b + RNReanimated: dd8c286ab5dd4ba36d3a7fef8bff7e08711b5476 + RNScreens: 0e91da98ab26d5d04c7b59a9b6bd694124caf88c + Yoga: 7740b94929bbacbddda59bf115b5317e9a161598 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 8f699b318e5eb76c8de0974a5d5d844a7510bf71 +PODFILE CHECKSUM: 73f909c2b4533e55ed87d09d4f712b98f76fa947 -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/ios/dooboo.xcodeproj/project.pbxproj b/ios/dooboo.xcodeproj/project.pbxproj index 269bf87a..1fa8aeb0 100644 --- a/ios/dooboo.xcodeproj/project.pbxproj +++ b/ios/dooboo.xcodeproj/project.pbxproj @@ -209,6 +209,7 @@ 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, + B65016E1FF7A0AFFF2424D72 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -230,6 +231,7 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + CD29E76325DC909268881D9A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -477,6 +479,42 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + B65016E1FF7A0AFFF2424D72 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-dooboo-doobooTests/Pods-dooboo-doobooTests-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-dooboo-doobooTests/Pods-dooboo-doobooTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + CD29E76325DC909268881D9A /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-dooboo/Pods-dooboo-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-dooboo/Pods-dooboo-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/jest.config.js b/jest.config.js index 7509195a..1ca5c9cb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,11 +1,10 @@ /* eslint-disable @typescript-eslint/no-var-requires */ -const jestPreset = require('@testing-library/react-native/jest-preset'); const { defaults: tsjPreset } = require('ts-jest/presets'); /* eslint-enable @typescript-eslint/no-var-requires */ module.exports = { ...tsjPreset, - preset: '@testing-library/react-native', + preset: 'react-native', automock: false, transform: { '^.+\\.(js)$': '/node_modules/babel-jest', @@ -33,7 +32,6 @@ module.exports = { }, setupFiles: [ './node_modules/react-native-gesture-handler/jestSetup.js', - ...jestPreset.setupFiles, '/test/jestSetup.js', '/test/jestSetup.ts', ], diff --git a/package.json b/package.json index 4968b472..8dbb3962 100644 --- a/package.json +++ b/package.json @@ -35,50 +35,47 @@ }, "dependencies": { "@dooboo-ui/native-theme": "^0.1.7", - "@react-native-community/async-storage": "^1.11.0", + "@react-native-community/async-storage": "^1.12.0", "@react-native-community/masked-view": "^0.1.10", - "@react-navigation/core": "^5.11.1", - "@react-navigation/native": "^5.6.1", - "@react-navigation/stack": "^5.6.2", - "i18n-js": "^3.7.1", + "@react-navigation/core": "^5.14.1", + "@react-navigation/native": "^5.8.7", + "@react-navigation/stack": "^5.12.4", + "i18n-js": "^3.8.0", "react": "16.13.1", - "react-native": "0.62.2", - "react-native-gesture-handler": "^1.6.1", - "react-native-localize": "^1.4.0", - "react-native-reanimated": "^1.9.0", - "react-native-safe-area-context": "^3.0.7", - "react-native-screens": "^2.9.0", - "styled-components": "^5.1.1" + "react-native": "0.63.3", + "react-native-gesture-handler": "^1.8.0", + "react-native-localize": "^1.4.3", + "react-native-reanimated": "^1.13.1", + "react-native-safe-area-context": "^3.1.8", + "react-native-screens": "^2.13.0", + "styled-components": "^5.2.1" }, "devDependencies": { - "@babel/cli": "^7.10.4", - "@babel/core": "^7.10.4", - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/plugin-proposal-object-rest-spread": "^7.10.4", - "@babel/preset-typescript": "^7.10.4", - "@babel/runtime": "^7.10.4", - "@dooboo/eslint-config": "^0.4.3", - "@testing-library/jest-native": "^3.1.0", - "@testing-library/react-native": "^5.0.3", + "@babel/cli": "^7.12.1", + "@babel/core": "^7.12.3", + "@babel/preset-typescript": "^7.12.1", + "@babel/runtime": "^7.12.5", + "@dooboo/eslint-config": "^0.5.4", + "@testing-library/jest-native": "^3.4.3", + "@testing-library/react-native": "^7.1.0", "@types/i18n-js": "^3.0.3", - "@types/jest": "^26.0.4", - "@types/react": "^16.9.41", - "@types/react-native": "^0.62.17", - "@types/react-test-renderer": "^16.9.2", - "@types/styled-components": "^5.1.1", - "babel-jest": "^26.1.0", - "babel-preset-react-native": "^5.0.2", - "codecov": "^3.7.0", - "eslint": "^7.4.0", - "jest": "^26.1.0", + "@types/jest": "^26.0.15", + "@types/react": "^16.9.56", + "@types/react-native": "^0.63.33", + "@types/react-test-renderer": "^16.9.3", + "@types/styled-components": "^5.1.4", + "babel-jest": "^26.6.3", + "codecov": "^3.8.1", + "eslint": "^7.13.0", + "jest": "^26.6.3", "jest-fetch-mock": "^3.0.3", - "jest-styled-components": "^7.0.2", + "jest-styled-components": "^7.0.3", "jetifier": "^1.6.6", - "metro-react-native-babel-preset": "^0.60.0", - "prettier": "^2.0.5", + "metro-react-native-babel-preset": "^0.63.0", + "prettier": "^2.1.2", "react-dom": "^16.13.1", "react-test-renderer": "16.13.1", - "ts-jest": "^26.1.1", - "typescript": "3.9.6" + "ts-jest": "^26.4.4", + "typescript": "4.0.5" } } diff --git a/src/apis/__tests__/sample.test.ts b/src/apis/__tests__/sample.test.ts index df2cb9dc..ba552875 100644 --- a/src/apis/__tests__/sample.test.ts +++ b/src/apis/__tests__/sample.test.ts @@ -1,20 +1,21 @@ import { ROOT_URL, sample } from '../sample'; -import { FetchMock } from 'jest-fetch-mock'; - -const fetchMock = fetch as FetchMock; +import fetchMock from 'jest-fetch-mock'; describe('testing sample api', () => { beforeEach(() => { + fetchMock.enableMocks(); fetchMock.resetMocks(); }); it('calls google and returns data to me', () => { const mockedResult = JSON.stringify({ data: '12345' }); + fetchMock.mockResponseOnce(mockedResult); return sample({ zoyi: 'zoyi' }).then(async (res) => { const result = await res.text(); + expect(result).toEqual(mockedResult); expect(fetchMock.mock.calls.length).toEqual(1); @@ -37,6 +38,7 @@ describe('testing sample api', () => { it('throws an error if error occurs', () => { fetchMock.mockRejectedValue(new Error('error')); + // fetchMock.mockResponseOnce(() => // sample(null).then(() => Promise.reject(new Error())), // ); diff --git a/src/apis/sample.ts b/src/apis/sample.ts index 92c6fe48..2e3a2fa7 100644 --- a/src/apis/sample.ts +++ b/src/apis/sample.ts @@ -20,6 +20,7 @@ export const sample = async ( try { const res: Response = await fetch(`${ROOT_URL}`, fetchOption); + return res; } catch (err) { throw new Error(err); diff --git a/src/components/navigation/RootStackNavigator.tsx b/src/components/navigation/RootStackNavigator.tsx index ab30e4e7..3c3ecc79 100644 --- a/src/components/navigation/RootStackNavigator.tsx +++ b/src/components/navigation/RootStackNavigator.tsx @@ -1,3 +1,5 @@ +import 'react-native-gesture-handler'; + import { StackNavigationProp, createStackNavigator } from '@react-navigation/stack'; import { ThemeType, useThemeContext } from '@dooboo-ui/native-theme'; @@ -20,6 +22,7 @@ const Stack = createStackNavigator(); function RootNavigator(): React.ReactElement { const { theme, themeType } = useThemeContext(); + return ( { beforeEach(() => { props = createTestProps(); + component = createTestElement( , ); @@ -21,7 +22,9 @@ describe('[Stack] navigator', () => { it('should renders without crashing', () => { jest.useFakeTimers(); + const rendered = renderer.create(component).toJSON(); + jest.runAllTimers(); expect(rendered).toMatchSnapshot(); expect(rendered).toBeTruthy(); @@ -30,7 +33,9 @@ describe('[Stack] navigator', () => { it('should renders [Dark] mode', () => { jest.useFakeTimers(); component = createTestElement(, ThemeType.DARK); + const rendered = renderer.create(component).toJSON(); + jest.runAllTimers(); expect(rendered).toMatchSnapshot(); expect(rendered).toBeTruthy(); diff --git a/src/components/navigation/__tests__/__snapshots__/RootStackNavigator.test.tsx.snap b/src/components/navigation/__tests__/__snapshots__/RootStackNavigator.test.tsx.snap index 3f409828..ec263d0c 100644 --- a/src/components/navigation/__tests__/__snapshots__/RootStackNavigator.test.tsx.snap +++ b/src/components/navigation/__tests__/__snapshots__/RootStackNavigator.test.tsx.snap @@ -55,6 +55,7 @@ exports[`[Stack] navigator should renders [Dark] mode 1`] = ` onClose={[Function]} onGestureBegin={[Function]} onGestureCanceled={[Function]} + onGestureEnd={[Function]} onOpen={[Function]} onTransitionStart={[Function]} pointerEvents="box-none" @@ -95,6 +96,7 @@ exports[`[Stack] navigator should renders [Dark] mode 1`] = ` } > (false); const onLogin = (): void => { setIsLoggingIn(true); + timer = setTimeout(() => { const user: User = { displayName: 'dooboolab', age: 30, job: 'developer', }; + setUser(user); setIsLoggingIn(false); clearTimeout(timer); diff --git a/src/components/screen/Temp.tsx b/src/components/screen/Temp.tsx index c3908eb1..c8f8fb55 100644 --- a/src/components/screen/Temp.tsx +++ b/src/components/screen/Temp.tsx @@ -20,6 +20,7 @@ interface Props { function Page(props: Props): React.ReactElement { const { route: { params: { param } }, navigation } = props; + return (