Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
48a9931
Tests are noisy, but are passing locally!
AndrewGable Sep 4, 2020
d18bf2f
Clean up workflow and job names for GitHub actions
AndrewGable Sep 8, 2020
4db0827
Move tests and mocks into a tests/ folder, configure Jest to find it …
AndrewGable Sep 8, 2020
16f9fb0
Continue to configure.. Tests are silent on my machine
AndrewGable Sep 8, 2020
6b92a1f
Continue to explore unit tests
AndrewGable Sep 9, 2020
0914a43
Start to add detox
AndrewGable Sep 10, 2020
fd79338
Merge branch 'master' into andrew-test
AndrewGable Sep 17, 2020
7ee502c
Tweak configs
AndrewGable Sep 17, 2020
08d384b
Continue config of detox
AndrewGable Sep 17, 2020
e54bd90
Add passing tests
AndrewGable Sep 17, 2020
6c49e8d
Install xcpretty from gem
AndrewGable Sep 17, 2020
276e2c7
Tweak sim used
AndrewGable Sep 18, 2020
5b95625
Add more logs
AndrewGable Sep 18, 2020
b0432aa
Increase timeout
AndrewGable Sep 18, 2020
ca94b4a
Merge branch 'master' into andrew-test
AndrewGable Oct 5, 2020
6e32bdf
Try to use release configs
AndrewGable Oct 5, 2020
daf8312
Debug -> Release
AndrewGable Oct 5, 2020
9941403
Update detox to latest
AndrewGable Oct 5, 2020
de68055
Tweaking config a bit
AndrewGable Oct 6, 2020
1e42322
Updating things, still not sure what is wrong
AndrewGable Oct 6, 2020
d59b3b2
Merge branch 'master' into andrew-test
AndrewGable Oct 6, 2020
5b7fe44
Add more logs
AndrewGable Oct 6, 2020
96c6af8
Add ssh key
AndrewGable Oct 6, 2020
a3eba2f
Fix lint
AndrewGable Oct 7, 2020
80782ff
Try to mock libraries
AndrewGable Oct 7, 2020
8c2454a
Remove mocks
AndrewGable Oct 7, 2020
fd4ae9e
Test not using config, will need to revert this
AndrewGable Oct 7, 2020
00e66dc
add ssh key for npm install
AndrewGable Oct 7, 2020
72400b4
Merge branch 'master' into andrew-test
AndrewGable Oct 19, 2020
916174e
Jest tests passing locally
AndrewGable Oct 19, 2020
34151bb
Fix lint
AndrewGable Oct 19, 2020
89c57c3
Merge branch 'master' into andrew-test
AndrewGable Nov 4, 2020
12ae6b3
Tweaking configs, names, and directories.
AndrewGable Nov 4, 2020
cdb8f5b
Fix lint
AndrewGable Nov 4, 2020
b5fd3f0
Remove hard coded config
AndrewGable Nov 4, 2020
8819cb1
Use Xcode 11.5
AndrewGable Nov 4, 2020
e86066d
Merge branch 'master' into andrew-test
AndrewGable Nov 4, 2020
d42ef6e
Apply peer review changes
AndrewGable Nov 5, 2020
618b789
Update readme and add two new scripts
AndrewGable Nov 5, 2020
1efe05c
Merge branch 'master' into andrew-test
AndrewGable Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
rules: {
'react/jsx-filename-extension': [1, {extensions: ['.js']}],
},
plugins: ['detox'],
env: {
jest: true
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: automerge
name: Automerge PR

# This workflow is triggered by a pull request that is labeled
on:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: E2E iOS Tests

# Only run e2e tests on branches that aren't related to master and the deploy process
on:
push:
branches-ignore:
- 'master'
- 'version-bump-*'
tags-ignore:
- '*'

env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer

jobs:
test:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1

- name: Install bundler
run: gem install bundler

- name: Install gems
run: bundle install

- uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Install node packages
run: npm install

- name: Install detox
run: npm install -g detox-cli

- name: Install cocoapods
run: cd ios && pod install --repo-update

- name: Install brew depdencies
run: |
brew tap wix/brew
brew install applesimutils

- name: Build tests
run: detox build --configuration ios.sim.release

- name: Run tests
run: detox test --configuration ios.sim.release --cleanup --debug-synchronization 200 --loglevel trace
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: eslint
name: Lint JavaScript

# Only lint on branches that aren't related to master and the deploy process
on:
Expand All @@ -10,7 +10,7 @@ on:
- '*'

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Jest Unit Tests

# Only run unit tests on branches that aren't related to master and the deploy process
on:
push:
branches-ignore:
- 'master'
- 'version-bump-*'
tags-ignore:
- '*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: npm install
- run: npm run test
env:
CI: true
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [master]

jobs:
build:
version:
runs-on: ubuntu-16.04

steps:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"
gem "xcpretty"
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ You can use any IDE or code editing tool for developing on any platform. Use you
* To run the **Development app**, run: `npm run desktop`, this will start a new Electron process running on your MacOS desktop in the `dist/Mac` folder.

## Running the tests 🎰
* To run the **Jest Unit Tests**: `npm run test`
### Unit tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add more info in this Readme about the difference between unit tests and e2e tests and when you would use one instead of the other and the benefits of either of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

* To run the **Jest unit tests**: `npm run test`

### End to end tests
[Detox](https://github.com/wix/Detox) is a _"Gray box end-to-end testing and automation library"_

You are first required to build the tests, then you can run them:
1. To build the **Detox end to end tests**: `npm run detox-build`
2. To run the **Detox end to end tests**: `npm run detox-test`

## Troubleshooting
1. If you are having issues with **_Getting Started_**, please reference [React Native's Documentation](https://reactnative.dev/docs/environment-setup)
Expand Down
14 changes: 0 additions & 14 deletions __tests__/App-test.js

This file was deleted.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ module.exports = ({caller}) => {
// For `react-native` (iOS/Android) caller will be "metro"
// For `webpack` (Web) caller will be "@babel-loader"
const runningIn = caller(({name}) => name);
return runningIn === 'metro' ? metro : webpack;
return ['metro', 'babel-jest'].includes(runningIn) ? metro : webpack;
};
20 changes: 20 additions & 0 deletions detox.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
testRunner: 'jest',
runnerConfig: 'tests/e2e/config.json',
configurations: {
'ios.sim.debug': {
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Chat.app',
build: 'xcodebuild -workspace ios/ReactNativeChat.xcworkspace -scheme ReactNativeChat -configuration '
+ 'Debug -sdk iphonesimulator -derivedDataPath ios/build | xcpretty',
type: 'ios.simulator',
name: 'iPhone 11'
},
'ios.sim.release': {
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Chat.app',
build: 'xcodebuild -workspace ios/ReactNativeChat.xcworkspace -scheme ReactNativeChat -configuration '
+ 'Release -sdk iphonesimulator -derivedDataPath ios/build | xcpretty',
type: 'ios.simulator',
name: 'iPhone 11'
},
},
};
126 changes: 63 additions & 63 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ PODS:
- React-Core (= 0.63.3)
- React-jsi (= 0.63.3)
- ReactCommon/turbomodule/core (= 0.63.3)
- Firebase/Analytics (6.30.0):
- Firebase/Analytics (6.34.0):
- Firebase/Core
- Firebase/Core (6.30.0):
- Firebase/Core (6.34.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 6.7.2)
- Firebase/CoreOnly (6.30.0):
- FirebaseCore (= 6.10.0)
- Firebase/Crashlytics (6.30.0):
- FirebaseAnalytics (= 6.9.0)
- Firebase/CoreOnly (6.34.0):
- FirebaseCore (= 6.10.4)
- Firebase/Crashlytics (6.34.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 4.4.0)
- FirebaseAnalytics (6.7.2):
- FirebaseCore (~> 6.8)
- FirebaseInstallations (~> 1.4)
- GoogleAppMeasurement (= 6.7.2)
- FirebaseCrashlytics (~> 4.6.2)
- FirebaseAnalytics (6.9.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.7)
- GoogleAppMeasurement (= 6.9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30905.0)
- FirebaseCore (6.10.0):
- FirebaseCoreDiagnostics (~> 1.3)
- nanopb (~> 1.30906.0)
- FirebaseCore (6.10.4):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- FirebaseCoreDiagnostics (1.5.0):
- GoogleDataTransport (~> 7.0)
- FirebaseCoreDiagnostics (1.7.0):
- GoogleDataTransport (~> 7.4)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- nanopb (~> 1.30905.0)
- FirebaseCrashlytics (4.4.0):
- nanopb (~> 1.30906.0)
- FirebaseCrashlytics (4.6.2):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleDataTransport (~> 7.2)
- nanopb (~> 1.30905.0)
- nanopb (~> 1.30906.0)
- PromisesObjC (~> 1.2)
- FirebaseInstallations (1.7.0):
- FirebaseCore (~> 6.10)
Expand Down Expand Up @@ -118,14 +118,14 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- GoogleAppMeasurement (6.7.2):
- GoogleAppMeasurement (6.9.0):
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30905.0)
- GoogleDataTransport (7.2.0):
- nanopb (~> 1.30905.0)
- nanopb (~> 1.30906.0)
- GoogleDataTransport (7.5.0):
- nanopb (~> 1.30906.0)
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
Expand All @@ -145,11 +145,11 @@ PODS:
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.7.2):
- GoogleUtilities/Logger
- nanopb (1.30905.0):
- nanopb/decode (= 1.30905.0)
- nanopb/encode (= 1.30905.0)
- nanopb/decode (1.30905.0)
- nanopb/encode (1.30905.0)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- OpenSSL-Universal (1.0.2.20):
- OpenSSL-Universal/Static (= 1.0.2.20)
- OpenSSL-Universal/Static (1.0.2.20)
Expand Down Expand Up @@ -326,14 +326,14 @@ PODS:
- React
- react-native-document-picker (4.0.0):
- React-Core
- react-native-image-picker (2.3.3):
- React
- react-native-netinfo (5.9.6):
- React
- react-native-safe-area-context (3.1.4):
- React
- react-native-webview (10.6.0):
- React
- react-native-image-picker (2.3.4):
- React-Core
- react-native-netinfo (5.9.7):
- React-Core
- react-native-safe-area-context (3.1.8):
- React-Core
- react-native-webview (10.9.2):
- React-Core
- React-RCTActionSheet (0.63.3):
- React-Core/RCTActionSheetHeaders (= 0.63.3)
- React-RCTAnimation (0.63.3):
Expand Down Expand Up @@ -394,19 +394,19 @@ PODS:
- React-Core (= 0.63.3)
- React-cxxreact (= 0.63.3)
- React-jsi (= 0.63.3)
- RNCAsyncStorage (1.11.0):
- React
- RNCPushNotificationIOS (1.5.0):
- React
- RNFBAnalytics (7.6.7):
- Firebase/Analytics (~> 6.30.0)
- RNCAsyncStorage (1.12.1):
- React-Core
- RNCPushNotificationIOS (1.6.1):
- React-Core
- RNFBAnalytics (7.6.8):
- Firebase/Analytics (~> 6.34.0)
- React-Core
- RNFBApp
- RNFBApp (8.4.5):
- Firebase/CoreOnly (~> 6.30.0)
- RNFBApp (8.4.6):
- Firebase/CoreOnly (~> 6.34.0)
- React-Core
- RNFBCrashlytics (8.4.9):
- Firebase/Crashlytics (~> 6.30.0)
- RNFBCrashlytics (8.4.10):
- Firebase/Crashlytics (~> 6.34.0)
- React-Core
- RNFBApp
- urbanairship-react-native (8.1.0):
Expand Down Expand Up @@ -590,11 +590,11 @@ SPEC CHECKSUMS:
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 878b59e31113e289e275165efbe4b54fa614d43d
FBReactNativeSpec: 7da9338acfb98d4ef9e5536805a0704572d33c2f
Firebase: 210f41ca352067d83b1ba4fd2e7fb49a0c017397
FirebaseAnalytics: a299a86ef70fcc6aa011418bc65a7e101fb9636c
FirebaseCore: 9a41e2de78fef10f63cee30ab10e2945266bc1fc
FirebaseCoreDiagnostics: 7535fe695737f8c5b350584292a70b7f8ff0357b
FirebaseCrashlytics: 859918905322e8816d2b5ab7fe54bf5a0c84d21c
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
FirebaseAnalytics: 3bb096873ee0d7fa4b6c70f5e9166b6da413cc7f
FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseCrashlytics: 1a747c9cc084a24dc6d9511c991db1cd078154eb
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Expand All @@ -605,10 +605,10 @@ SPEC CHECKSUMS:
FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
GoogleAppMeasurement: 3def7652b1f5b5a576178dc332e2a36a260fbef6
GoogleDataTransport: 672fb0ce96fe7f7f31d43672fca62ad2c9c86f7b
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleDataTransport: 445302b7da4216da63071a4c29e7023f47192e5a
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
nanopb: c43f40fadfe79e8b8db116583945847910cbabc9
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
OpenSSL-Universal: ff34003318d5e1163e9529b08470708e389ffcdd
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
RCTRequired: 48884c74035a0b5b76dbb7a998bd93bcfc5f2047
Expand All @@ -623,10 +623,10 @@ SPEC CHECKSUMS:
React-jsinspector: 8e68ffbfe23880d3ee9bafa8be2777f60b25cbe2
react-native-config: 9a061347e0136fdb32d43a34d60999297d672361
react-native-document-picker: b3e78a8f7fef98b5cb069f20fc35797d55e68e28
react-native-image-picker: a6c3d644751a388b0fc8b56822ff7cbd398a3008
react-native-netinfo: d2c312fa4b151214e1d5c8456ddb5f28ff24a576
react-native-safe-area-context: 0ed9288ed4409beabb0817b54efc047286fc84da
react-native-webview: 797f50d16bb271c4270bc742040a64c79ec7147c
react-native-image-picker: 32d1ad2c0024ca36161ae0d5c2117e2d6c441f11
react-native-netinfo: e36c1bb6df27ab84aa933679b3f5bbf9d180b18f
react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6
react-native-webview: c51f73be304c61d359ec3e7c5e4e8f2c977fd360
React-RCTActionSheet: 53ea72699698b0b47a6421cb1c8b4ab215a774aa
React-RCTAnimation: 1befece0b5183c22ae01b966f5583f42e69a83c2
React-RCTBlob: 0b284339cbe4b15705a05e2313a51c6d8b51fa40
Expand All @@ -637,11 +637,11 @@ SPEC CHECKSUMS:
React-RCTText: 65a6de06a7389098ce24340d1d3556015c38f746
React-RCTVibration: 8e9fb25724a0805107fc1acc9075e26f814df454
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
RNCAsyncStorage: db711e29e5e0500d9bd21aa0c2e397efa45302b1
RNCPushNotificationIOS: 8025ff0b610d7b28d29ddc1b619cd55814362e4c
RNFBAnalytics: 6fe130045b06fb4173d6f44058894007bb30b9a2
RNFBApp: 570b136767f588b7eef0ab918284e9fe364d0c3e
RNFBCrashlytics: 7b60463c742f830255fa76f13a837f95c6581700
RNCAsyncStorage: cb9a623793918c6699586281f0b51cbc38f046f9
RNCPushNotificationIOS: cfc6e1821f1af1874741d9b7055b75c0f8fa8a7d
RNFBAnalytics: 2dc4dd9e2445faffca041b10447a23a71dcdabf8
RNFBApp: 7eacc7da7ab19f96c05e434017d44a9f09410da8
RNFBCrashlytics: 4870c14cf8833053b6b5648911abefe1923854d2
urbanairship-react-native: fa123940041a6a13ab7dac192e32833c53754f00
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
Expand Down
Loading