chore: github actions (#3472)

This commit is contained in:
Mike Diarmid
2020-04-17 14:54:16 +01:00
committed by GitHub
parent b412c7139a
commit e427fcfd9b
50 changed files with 511 additions and 576 deletions

View File

@@ -1,6 +1,15 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
"plugin:react/recommended",
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
settings: {
react: {
version: '16.1.0',
@@ -27,7 +36,8 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/camelcase': 'warn',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
globals: {
__DEV__: true,

70
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
name: Code Quality Checks
on: [pull_request]
jobs:
linting:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
name: Yarn Cache
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
run: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run lint
- name: Save Code Linting Report JSON
run: yarn run lint:report
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@1.0.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint-report.json"
- name: Upload ESLint report
uses: actions/upload-artifact@v1
with:
name: eslint-report.json
path: eslint-report.json
typescript:
name: TypeScript Build Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
name: Yarn Cache
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
run: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run tsc:compile

197
.github/workflows/tests_e2e.yml vendored Normal file
View File

@@ -0,0 +1,197 @@
name: Testing E2E
on: [pull_request]
jobs:
# ------------------
# Android
# ------------------
android:
name: Android
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
# Yarn cache directory on macOS GH Action virtual environment isn't empty;
# -> https://github.com/actions/virtual-environments/issues/427
# -> https://github.com/actions/cache/issues/187
- name: Clean Yarn cache directory
run: yarn cache clean
# Gradle cache directory on macOS GH Action virtual environment isn't empty;
# -> https://github.com/actions/virtual-environments/issues/427
- name: Clean Gradle cache directory
run: rm -rf ~/.gradle/caches
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
name: Yarn Cache
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-v1
- uses: actions/cache@v1
name: Gradle Cache
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-v1
- name: Yarn Install
run: |
export DETOX_DISABLE_POSTINSTALL=1
yarn --no-audit --prefer-offline
- name: Setup JDK8
uses: actions/setup-java@v1
with:
java-version: '8'
architecture: 'x64'
- name: Build Android App
run: cd tests/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false
- name: Download Emulator Image
run: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-28;google_apis;x86" "platform-tools" "emulator"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestingAVD --device "Nexus 4" -k 'system-images;android-28;google_apis;x86' -g google_apis
$ANDROID_HOME/emulator/emulator -list-avds
# # TODO broken
# - name: Start Android Emulator
# timeout-minutes: 10
# continue-on-error: true
# run: |
# echo "Starting emulator"
# nohup $ANDROID_HOME/emulator/emulator -avd TestingAVD -cores 2 -memory 2048 -no-audio -no-snapshot -no-window -no-boot-anim &
# $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'
# $ANDROID_HOME/platform-tools/adb devices
# $ANDROID_HOME/platform-tools/adb shell settings put global window_animation_scale 0.0
# $ANDROID_HOME/platform-tools/adb shell settings put global transition_animation_scale 0.0
# $ANDROID_HOME/platform-tools/adb shell settings put global animator_duration_scale 0.0
#
# echo "Emulator started"
#
# - name: Detox Test
# run: |
# nohup yarn run tests:packager:jet &
# nohup sh -c "until false; do $ANDROID_HOME/platform-tools/adb shell input tap 100 800; sleep 0.1; done" &
# nohup sh -c "$ANDROID_HOME/platform-tools/adb logcat '*:E'" &
# printf 'Waiting for packager to come online'
# until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
# printf '.'
# sleep 2
# done
# echo "Packager is online!"
# cd tests
# ./node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration android.emu.debug --cleanup
# shell: bash
# - name: Upload App
# uses: actions/upload-artifact@v1
# with:
# name: android_app
# path: tests/android/app/build/outputs/apk/debug/app-debug.apk
# ------------------
# iOS
# ------------------
ios:
name: iOS
runs-on: macos-latest
timeout-minutes: 30
env:
# Use the latest version of xcode for rnfirebase
# See link below for available versions;
# -> https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md#xcode
DEVELOPER_DIR: /Applications/Xcode_11.4.app
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
# Yarn cache directory on macOS GH Action virtual environment isn't empty;
# -> https://github.com/actions/virtual-environments/issues/427
# -> https://github.com/actions/cache/issues/187
- name: Clean Yarn cache directory
run: yarn cache clean
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
name: Yarn Cache
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-v1
- uses: actions/cache@v1
name: Cache Pods
with:
path: tests/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}-v1
- uses: actions/cache@v1
name: Detox Framework Cache
with:
path: ~/Library/Detox/ios
key: ${{ runner.os }}-detox-framework-cache-${{ env.DEVELOPER_DIR }}
- name: Yarn Install
run: yarn --no-audit --prefer-offline
- name: Pod Install
run: |
gem update cocoapods xcodeproj
cd tests/ios
pod install
shell: bash
- name: Build iOS App
run: |
export SKIP_BUNDLING=1
export RCT_NO_LAUNCH_PACKAGER=1
cd tests
./node_modules/.bin/detox build --configuration ios.ci
shell: bash
- name: Install applesimutils
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
brew tap wix/brew
brew install applesimutils
applesimutils --list
shell: bash
- name: Detox Test
run: |
nohup yarn run tests:packager:jet &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
sleep 2
done
echo "Packager is online!"
cd tests
./node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration ios.ci --cleanup
shell: bash
# - name: Upload App
# uses: actions/upload-artifact@v1
# with:
# name: ios_app
# path: tests/ios/build/Build/Products/Debug-iphonesimulator/testing.app

1
.gitignore vendored
View File

@@ -556,3 +556,4 @@ appPlaygrounds/
app.playground.js
app.admob.js
app.smartreply.js
eslint-report.json

View File

@@ -5,7 +5,6 @@
],
"packages": [
"packages/*",
"packages/template/project",
"tests"
],
"useWorkspaces": true,

View File

@@ -2,14 +2,14 @@
"name": "react-native-firebase",
"private": true,
"scripts": {
"prepare": "yarn run lerna:link && lerna run prepare",
"prepare": "yarn run lerna:link && lerna run prepare --parallel",
"build:all:clean": "lerna run build:clean",
"build:all:build": "lerna run build",
"validate:all:js": "eslint . --ext .js,.jsx,.ts,.tsx",
"validate:all:ts": "tsc --project .",
"validate:all:flow": "echo ''",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:report": "eslint --output-file=eslint-report.json --format=json . --ext .js,.jsx,.ts,.tsx",
"tsc:compile": "tsc --project .",
"lerna:bootstrap": "lerna bootstrap",
"lerna:link": "lerna link && lerna exec -- yarn link",
"lerna:link": "lerna link",
"lerna:clean": "lerna clean",
"gen:reference": "node scripts/generate-typedoc.js",
"generate-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -t -v -l",
@@ -20,13 +20,13 @@
"tests:android:build-release": "cd tests && ./node_modules/.bin/detox build --configuration android.emu.release",
"tests:android:test": "cd tests && ./node_modules/.bin/detox test --configuration android.emu.debug",
"tests:android:test-reuse": "cd tests && ./node_modules/.bin/detox test --configuration android.emu.debug --reuse",
"tests:android:test-cover": "cd tests && nyc ./node_modules/.bin/detox test --configuration android.emu.debug",
"tests:android:test-cover-reuse": "cd tests && nyc ./node_modules/.bin/detox test --configuration android.emu.debug --reuse",
"tests:android:test-cover": "cd tests && ./node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration android.emu.debug",
"tests:android:test-cover-reuse": "cd tests && ./node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration android.emu.debug --reuse",
"tests:ios:build": "cd tests && ./node_modules/.bin/detox build --configuration ios.sim.debug",
"tests:ios:build-release": "cd tests && ./node_modules/.bin/detox build --configuration ios.sim.release",
"tests:ios:test": "cd tests && ./node_modules/.bin/detox test --configuration ios.sim.debug --loglevel warn",
"tests:ios:test-reuse": "cd tests && ./node_modules/.bin/detox test --configuration ios.sim.debug --reuse --loglevel warn",
"tests:ios:test-cover": "cd tests && node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration ios.sim.debug",
"tests:ios:test-cover": "cd tests && ./node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration ios.sim.debug",
"tests:ios:test-cover-reuse": "cd tests && node_modules/.bin/nyc ./node_modules/.bin/detox test --configuration ios.sim.debug --reuse --loglevel warn",
"tests:ios:pod:install": "cd tests && cd ios && rm -rf ReactNativeFirebaseDemo.xcworkspace && pod install && cd ..",
"npm:version:release:patch": "echo '!!🔴!! RELEASE !!🔴!!' && lerna version patch --no-git-tag-version --no-push --exact --force-publish=*",
@@ -36,29 +36,36 @@
"format:markdown": "prettier --write \"docs/**/*.md\""
},
"devDependencies": {
"axios": "^0.19.0",
"inquirer": "^6.2.2",
"inquirer": "^7.1.0",
"shelljs": "^0.8.3",
"@react-native-community/eslint-config": "^1.0.0",
"codecov": "^3.6.5",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"genversion": "^2.2.0",
"lerna": "3.20.2",
"rimraf": "^3.0.2",
"typedoc": "^0.15.0",
"typescript": "^3.8.3",
"@types/react-native": "^0.62.0"
"@types/react-native": "^0.62.0",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.19.0",
"prettier": "^1.19.1"
},
"workspaces": {
"packages": [
"packages/*",
"packages/template/project",
"tests"
],
"nohoist": [
"packages/template/project/react-native",
"packages/template/project/react-native/**",
"**/sinon",
"**/sinon/**",
"**/should",
"**/should/**",
"**/should-sinon",
"**/should-sinon/**",
"detox",
"**/detox",
"**/detox/**",

View File

@@ -57,7 +57,6 @@ function BannerAd({ unitId, size, requestOptions, ...props }) {
throw new Error(`BannerAd: ${e.message}`);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [parsedRequestOptions]);
function onNativeEvent({ nativeEvent }) {
@@ -78,6 +77,7 @@ function BannerAd({ unitId, size, requestOptions, ...props }) {
let style;
if (size === 'FLUID') {
// eslint-disable-next-line react/prop-types
style = props.style;
} else {
style = {

View File

@@ -89,14 +89,14 @@ export default createModuleNamespace({
export const firebase = getFirebaseRoot();
export AdsConsentDebugGeography from './AdsConsentDebugGeography';
export AdsConsentStatus from './AdsConsentStatus';
export MaxAdContentRating from './MaxAdContentRating';
export TestIds from './TestIds';
export AdEventType from './AdEventType';
export BannerAdSize from './BannerAdSize';
export RewardedAdEventType from './RewardedAdEventType';
export AdsConsent from './AdsConsent';
export InterstitialAd from './ads/InterstitialAd';
export RewardedAd from './ads/RewardedAd';
export BannerAd from './ads/BannerAd';
export { default as AdsConsentDebugGeography } from './AdsConsentDebugGeography';
export { default as AdsConsentStatus } from './AdsConsentStatus';
export { default as MaxAdContentRating } from './MaxAdContentRating';
export { default as TestIds } from './TestIds';
export { default as AdEventType } from './AdEventType';
export { default as BannerAdSize } from './BannerAdSize';
export { default as RewardedAdEventType } from './RewardedAdEventType';
export { default as AdsConsent } from './AdsConsent';
export { default as InterstitialAd } from './ads/InterstitialAd';
export { default as RewardedAd } from './ads/RewardedAd';
export { default as BannerAd } from './ads/BannerAd';

View File

@@ -638,6 +638,7 @@ export namespace FirebaseAnalyticsTypes {
search_term: string;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -23,7 +23,6 @@ import {
isOneOf,
isString,
isUndefined,
isArray,
} from '@react-native-firebase/app/lib/common';
import { validateStruct, validateCompound } from '@react-native-firebase/app/lib/common/struct';

View File

@@ -232,6 +232,7 @@ export namespace ReactNativeFirebase {
/**
* React Native Firebase `firebase.json` config
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FirebaseJsonConfig {}
}

View File

@@ -79,9 +79,7 @@ function getOrCreateModuleForApp(app, moduleNamespace) {
if (!hasMultiAppSupport && app.name !== DEFAULT_APP_NAME) {
throw new Error(
[
`You attempted to call "firebase.app('${
app.name
}').${moduleNamespace}" but; ${moduleNamespace} does not support multiple Firebase Apps.`,
`You attempted to call "firebase.app('${app.name}').${moduleNamespace}" but; ${moduleNamespace} does not support multiple Firebase Apps.`,
'',
`Ensure you access ${moduleNamespace} from the default application only.`,
].join('\r\n'),
@@ -153,9 +151,7 @@ function getOrCreateModuleForRoot(moduleNamespace) {
[
`You attempted to call "firebase.${moduleNamespace}(app)" but; ${moduleNamespace} does not support multiple Firebase Apps.`,
'',
`Ensure the app provided is the default Firebase app only and not the "${
_app.name
}" app.`,
`Ensure the app provided is the default Firebase app only and not the "${_app.name}" app.`,
].join('\r\n'),
);
}
@@ -215,9 +211,7 @@ export function firebaseAppModuleProxy(app, moduleNamespace) {
throw new Error(
[
`You attempted to use "firebase.app('${
app.name
}').${moduleNamespace}" but this module could not be found.`,
`You attempted to use "firebase.app('${app.name}').${moduleNamespace}" but this module could not be found.`,
'',
`Ensure you have installed and imported the '@react-native-firebase/${moduleNamespace}' package.`,
].join('\r\n'),

View File

@@ -188,7 +188,6 @@ describe('auth().currentUser', () => {
await firebase.auth().currentUser.sendEmailVerification(actionCodeSettings);
await firebase.auth().currentUser.delete();
} catch (error) {
console.log(error);
// Reject
try {
await firebase.auth().currentUser.delete();
@@ -197,7 +196,7 @@ describe('auth().currentUser', () => {
}
return Promise.reject(
new Error('sendEmailVerification(actionCodeSettings) caused an error'),
new Error('sendEmailVerification(actionCodeSettings) caused an error' + error.message),
);
}

View File

@@ -298,7 +298,7 @@ export namespace FirebaseAuthTypes {
* Returns an Object containing IDP-specific user data if the provider is one of Facebook,
* GitHub, Google, Twitter, Microsoft, or Yahoo.
*/
profile?: Object;
profile?: Record<string, any>;
/**
* Returns the provider ID for specifying which provider the information in `profile` is for.
*/
@@ -312,7 +312,7 @@ export namespace FirebaseAuthTypes {
/**
* A structure containing a User, an AuthCredential, the operationType, and any additional user
* information that was returned from the identity provider. operationType could be 'signIn' for
* a sign-in operation, 'link' for a linking operation and 'reauthenticate' for a reauthentication operation.
* a sign-in operation, 'link' for a linking operation and 'reauthenticate' for a re-authentication operation.
*
* TODO @salakar; missing credential, operationType
*/

View File

@@ -50,6 +50,7 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
export namespace FirebaseCrashlyticsTypes {
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -65,7 +65,12 @@ xdescribe('database().ref().on()', () => {
await firebase
.database()
.ref()
.on('value', () => {}, () => {}, 'foo');
.on(
'value',
() => {},
() => {},
'foo',
);
return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("'context' must be an object.");

View File

@@ -68,7 +68,12 @@ describe('database().ref().once()', () => {
await firebase
.database()
.ref()
.once('value', () => {}, () => {}, 'foo');
.once(
'value',
() => {},
() => {},
'foo',
);
return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("'context' must be a context object.");

View File

@@ -271,7 +271,8 @@ export default class DatabaseQuery extends ReferenceBase {
if (
!isUndefined(cancelCallbackOrContext) &&
(!isFunction(cancelCallbackOrContext) && !isObject(cancelCallbackOrContext))
!isFunction(cancelCallbackOrContext) &&
!isObject(cancelCallbackOrContext)
) {
throw new Error(
"firebase.database().ref().on(_, _, *) 'cancelCallbackOrContext' must be a function or object.",
@@ -360,7 +361,8 @@ export default class DatabaseQuery extends ReferenceBase {
if (
!isUndefined(failureCallbackOrContext) &&
(!isObject(failureCallbackOrContext) && !isFunction(failureCallbackOrContext))
!isObject(failureCallbackOrContext) &&
!isFunction(failureCallbackOrContext)
) {
throw new Error(
"firebase.database().ref().once(_, _, *) 'failureCallbackOrContext' must be a function or context.",

View File

@@ -404,7 +404,7 @@ export namespace FirebaseDatabaseTypes {
onDisconnect(): OnDisconnect;
}
export interface ThenableReference extends Reference {}
export type ThenableReference = Reference;
/**
* A Query sorts and filters the data at a Database location so only a subset of the child data
@@ -575,7 +575,7 @@ export namespace FirebaseDatabaseTypes {
* @param callback The callback function that was passed to `on()` or `undefined` to remove all callbacks.
* @param context The context that was passed to `on()`.
*/
off(eventType?: EventType, callback?: Function, context?: Object): void;
off(eventType?: EventType, callback?: Function, context?: Record<string, any>): void;
/**
* Listens for data changes at a particular location.
@@ -632,8 +632,8 @@ export namespace FirebaseDatabaseTypes {
on(
eventType?: EventType,
callback?: Function,
cancelCallbackOrContext?: Object,
context?: Object | null,
cancelCallbackOrContext?: Record<string, any>,
context?: Record<string, any> | null,
): Function;
/**

View File

@@ -95,9 +95,7 @@ class FirebaseDatabaseModule extends FirebaseModule {
if (!url.includes(this._customUrlOrRegion)) {
throw new Error(
`firebase.app().database().refFromURL(*) 'url' must be the same domain as the current instance (${
this._customUrlOrRegion
}). To use a different database domain, create a new Firebase instance.`,
`firebase.app().database().refFromURL(*) 'url' must be the same domain as the current instance (${this._customUrlOrRegion}). To use a different database domain, create a new Firebase instance.`,
);
}

View File

@@ -71,9 +71,7 @@ export default class FirestoreFieldValue {
validateArrayElements(elements);
} catch (e) {
throw new Error(
`firebase.firestore.FieldValue.arrayUnion(*) 'elements' called with invalid data. ${
e.message
}`,
`firebase.firestore.FieldValue.arrayUnion(*) 'elements' called with invalid data. ${e.message}`,
);
}
@@ -85,9 +83,7 @@ export default class FirestoreFieldValue {
validateArrayElements(elements);
} catch (e) {
throw new Error(
`firebase.firestore.FieldValue.arrayRemove(*) 'elements' called with invalid data. ${
e.message
}`,
`firebase.firestore.FieldValue.arrayRemove(*) 'elements' called with invalid data. ${e.message}`,
);
}

View File

@@ -81,9 +81,7 @@ export default class FirestoreQuery {
if (value === undefined) {
throw new Error(
`firebase.firestore().collection().${cursor}(*) You are trying to start or end a query using a document for which the field '${
order.fieldPath
}' (used as the orderBy) does not exist.`,
`firebase.firestore().collection().${cursor}(*) You are trying to start or end a query using a document for which the field '${order.fieldPath}' (used as the orderBy) does not exist.`,
);
}

View File

@@ -56,6 +56,7 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
export namespace FirebaseIidTypes {
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -56,6 +56,7 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
export namespace FirebaseInAppMessagingTypes {
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -344,6 +344,7 @@ export namespace FirebaseMessagingTypes {
* An interface representing all the available permissions that can be requested by your app via
* the `requestPermission` API.
*/
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
export interface IOSPermissions {
/**
* Request permission to display alerts.

View File

@@ -72,6 +72,7 @@ class FirebaseMessagingModule extends FirebaseModule {
AppRegistry.registerHeadlessTask('ReactNativeFirebaseMessagingHeadlessTask', () => {
if (!backgroundMessageHandler) {
// eslint-disable-next-line no-console
console.warn(
'No background message handler has been set. Set a handler via the "setBackgroundMessageHandler" method.',
);
@@ -83,6 +84,7 @@ class FirebaseMessagingModule extends FirebaseModule {
if (isIOS) {
this.emitter.addListener('messaging_message_received_background', remoteMessage => {
if (!backgroundMessageHandler) {
// eslint-disable-next-line no-console
console.warn(
'No background message handler has been set. Set a handler via the "setBackgroundMessageHandler" method.',
);
@@ -198,10 +200,11 @@ class FirebaseMessagingModule extends FirebaseModule {
const subscription = this.emitter.addListener('messaging_token_refresh', event => {
// TODO remove after v7.0.0, see: https://github.com/invertase/react-native-firebase/issues/2889
const { token } = event;
const tokenStringWithTokenAccessor = new String(token);
const tokenStringWithTokenAccessor = String(token);
Object.defineProperty(tokenStringWithTokenAccessor, 'token', {
enumerable: false,
get() {
// eslint-disable-next-line no-console
console.warn(
'firebase.messaging().onTokenRefresh(event => event.token) is deprecated, use onTokenRefresh(token => token) or call getToken() instead',
);

View File

@@ -56,6 +56,7 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
export namespace FirebaseLanguageTypes {
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -109,9 +109,7 @@ class FirebaseMlKitLanguageModule extends FirebaseModule {
validated.push(validateTextMessage(messages[i]));
} catch (e) {
throw new Error(
`firebase.naturalLanguage().suggestReplies(*) 'messages' object at index ${i} threw an error. ${
e.message
}.`,
`firebase.naturalLanguage().suggestReplies(*) 'messages' object at index ${i} threw an error. ${e.message}.`,
);
}
}

View File

@@ -585,7 +585,7 @@ export namespace FirebaseVisionTypes {
/**
* A single symbol representation.
*/
export interface VisionDocumentTextSymbol extends VisionDocumentTextBase {}
export type VisionDocumentTextSymbol = VisionDocumentTextBase;
/**
* Enum representing the detected break type.
@@ -655,7 +655,7 @@ export namespace FirebaseVisionTypes {
*
* A language is the BCP-47 language code, such as "en-US" or "sr-Latn".
*/
recognizedLanguages: String[];
recognizedLanguages: string[];
/**
* Returns the bounding rectangle of the detected text.
@@ -697,7 +697,7 @@ export namespace FirebaseVisionTypes {
*
* A language is the BCP-47 language code, such as "en-US" or "sr-Latn".
*/
recognizedLanguages: String[];
recognizedLanguages: string[];
/**
* Returns the bounding rectangle of the detected text.
@@ -735,7 +735,7 @@ export namespace FirebaseVisionTypes {
/**
* Roughly equivalent to a space-separated "word" in most Latin languages, or a character in others. For instance, if a word is split between two lines by a hyphen, each part is encoded as a separate Element.
*/
export interface VisionTextElement extends VisionTextBase {}
export type VisionTextElement = VisionTextBase;
/**
* Represents an image label return from `imageLabelerProcessImage()` and `cloudImageLabelerProcessImage()`.

View File

@@ -256,18 +256,18 @@ export const firebase = getFirebaseRoot();
// e.g.
// // import { VisionCloudTextRecognizerModelType } from '@react-native-firebase/ml-vision';
export VisionBarcodeFormat from './VisionBarcodeFormat';
export VisionFaceContourType from './VisionFaceContourType';
export VisionFaceLandmarkType from './VisionFaceLandmarkType';
export VisionBarcodeValueType from './VisionBarcodeValueType';
export VisionBarcodeEmailType from './VisionBarcodeEmailType';
export VisionBarcodePhoneType from './VisionBarcodePhoneType';
export VisionBarcodeAddressType from './VisionBarcodeAddressType';
export VisionFaceDetectorContourMode from './VisionFaceDetectorContourMode';
export VisionFaceDetectorLandmarkMode from './VisionFaceDetectorLandmarkMode';
export VisionBarcodeWifiEncryptionType from './VisionBarcodeWifiEncryptionType';
export VisionFaceDetectorPerformanceMode from './VisionFaceDetectorPerformanceMode';
export VisionCloudTextRecognizerModelType from './VisionCloudTextRecognizerModelType';
export VisionFaceDetectorClassificationMode from './VisionFaceDetectorClassificationMode';
export VisionDocumentTextRecognizedBreakType from './VisionDocumentTextRecognizedBreakType';
export VisionCloudLandmarkRecognizerModelType from './VisionCloudLandmarkRecognizerModelType';
export { default as VisionBarcodeFormat } from './VisionBarcodeFormat';
export { default as VisionFaceContourType } from './VisionFaceContourType';
export { default as VisionFaceLandmarkType } from './VisionFaceLandmarkType';
export { default as VisionBarcodeValueType } from './VisionBarcodeValueType';
export { default as VisionBarcodeEmailType } from './VisionBarcodeEmailType';
export { default as VisionBarcodePhoneType } from './VisionBarcodePhoneType';
export { default as VisionBarcodeAddressType } from './VisionBarcodeAddressType';
export { default as VisionFaceDetectorContourMode } from './VisionFaceDetectorContourMode';
export { default as VisionFaceDetectorLandmarkMode } from './VisionFaceDetectorLandmarkMode';
export { default as VisionBarcodeWifiEncryptionType } from './VisionBarcodeWifiEncryptionType';
export { default as VisionFaceDetectorPerformanceMode } from './VisionFaceDetectorPerformanceMode';
export { default as VisionCloudTextRecognizerModelType } from './VisionCloudTextRecognizerModelType';
export { default as VisionFaceDetectorClassificationMode } from './VisionFaceDetectorClassificationMode';
export { default as VisionDocumentTextRecognizedBreakType } from './VisionDocumentTextRecognizedBreakType';
export { default as VisionCloudLandmarkRecognizerModelType } from './VisionCloudLandmarkRecognizerModelType';

View File

@@ -25,7 +25,8 @@ android.describe('perf()', () => {
});
describe('setPerformanceCollectionEnabled()', () => {
it('true', async () => {
// TODO sometimes android launches with isPerformanceCollectionEnabled = false
xit('true', async () => {
should.equal(firebase.perf().isPerformanceCollectionEnabled, true);
await firebase.perf().setPerformanceCollectionEnabled(true);
should.equal(firebase.perf().isPerformanceCollectionEnabled, true);

View File

@@ -98,9 +98,7 @@ export default class HttpMetric extends MetricWithAttributes {
} else {
// eslint-disable-next-line no-console
console.warn(
`Warning: A firebase.perf.HttpMetric (${this._httpMethod}: ${
this._url
}) failed to provide a httpResponseCode; this metric will not be visible on the Firebase console.`,
`Warning: A firebase.perf.HttpMetric (${this._httpMethod}: ${this._url}) failed to provide a httpResponseCode; this metric will not be visible on the Firebase console.`,
);
}

View File

@@ -356,6 +356,7 @@ export namespace FirebasePerformanceTypes {
stop(): Promise<null>;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Statics {}
/**

View File

@@ -193,9 +193,7 @@ export default class StorageTask {
on(event, nextOrObserver, error, complete) {
if (event !== StorageStatics.TaskEvent.STATE_CHANGED) {
throw new Error(
`firebase.storage.StorageTask.on event argument must be a string with a value of '${
StorageStatics.TaskEvent.STATE_CHANGED
}'`,
`firebase.storage.StorageTask.on event argument must be a string with a value of '${StorageStatics.TaskEvent.STATE_CHANGED}'`,
);
}

View File

@@ -46,7 +46,7 @@ android {
}
defaultConfig {
applicationId "com.invertase.testing"
minSdkVersion 18
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
@@ -58,8 +58,6 @@ android {
testBuildType System.getProperty('testBuildType', 'debug')
// detox
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled true
}
splits {
abi {

View File

@@ -46,7 +46,7 @@ subprojects {
ext {
compileSdk = 28
buildTools = "28.0.3"
minSdk = 16
minSdk = 21
targetSdk = 28
}

View File

@@ -9,7 +9,7 @@
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.daemon=true
org.gradle.caching=true
org.gradle.parallel=false
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.

View File

@@ -35,118 +35,22 @@ import '@react-native-firebase/perf';
import '@react-native-firebase/remote-config';
import '@react-native-firebase/storage';
import jet from 'jet/platform/react-native';
import React, { Component } from 'react';
import { AppRegistry, NativeModules, StyleSheet, Text, View } from 'react-native';
import React from 'react';
import { AppRegistry, NativeModules, Text, View } from 'react-native';
jet.exposeContextProperty('NativeModules', NativeModules);
jet.exposeContextProperty('NativeEventEmitter', NativeEventEmitter);
jet.exposeContextProperty('module', firebase);
class Root extends Component {
constructor(props) {
super(props);
this.state = {
currentTest: null,
};
jet.exposeContextProperty('root', this);
}
render() {
const { currentTest } = this.state;
if (!currentTest) {
return (
<View style={[styles.container, styles.horizontal]}>
<Text style={[styles.item, styles.module]} testID="module">
{'No Tests Started'}
</Text>
<Text style={styles.item} testID="group">
{'N/A'}
</Text>
<Text style={styles.item} testID="title">
{"Ensure you're running the Jet Packager together with the Detox test command."}
</Text>
</View>
);
}
const module = (() => {
if (currentTest.parent && currentTest.parent.parent) {
return currentTest.parent.parent.title;
}
return currentTest.parent.title;
})();
const group = (() => {
if (currentTest.parent && currentTest.parent.parent) {
return currentTest.parent.title;
}
return '';
})();
const retrying = (() => {
const retry = currentTest.currentRetry();
if (retry > 0) {
return `⚠️ Test failed, retrying... (${retry})`;
}
return null;
})();
return (
<View style={[styles.container, styles.horizontal]}>
<Text style={[styles.item, styles.module]} testID="module">
{module}
</Text>
<Text style={styles.item} testID="group">
{group}
</Text>
<Text style={styles.item} testID="title">
{currentTest.title}
</Text>
{retrying && (
<Text style={[styles.retry, styles.item]} testID="title">
{retrying}
</Text>
)}
</View>
);
}
function Root() {
return (
<View
testID="welcome"
style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}
>
<Text style={{ fontSize: 25, marginBottom: 30 }}>Testing App</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
horizontal: {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
padding: 10,
},
item: {
marginBottom: 10,
textAlign: 'center',
},
retry: {
marginTop: 10,
fontSize: 20,
color: '#cccc33',
},
module: {
fontSize: 20,
fontWeight: 'bold',
},
group: {
fontSize: 16,
color: 'grey',
},
logo: {
height: 120,
marginBottom: 16,
width: 135,
},
});
AppRegistry.registerComponent('testing', () => Root);

View File

@@ -16,28 +16,9 @@
*
*/
const { resolve } = require('path');
const { existsSync } = require('fs');
const requireAll = require('require-all');
/**
*
* @param packageName
*/
function requirePackageTests(packageName) {
const e2eDir = `./../packages/${packageName}/e2e`;
if (existsSync(e2eDir)) {
console.log(`Loaded tests from ${resolve(e2eDir)}/*`);
requireAll({
dirname: resolve(e2eDir),
filter: /(.+e2e)\.js$/,
excludeDirs: /^\.(git|svn)$/,
recursive: true,
});
} else {
console.log(`No tests directory found for ${e2eDir}/*`);
}
}
// DO NOT USE EXCEPT FOR THIS REACT NATIVE FIREBASE TESTING PROJECT - YOU HAVE
// BEEN WARNED 🙃
require('@react-native-firebase/private-tests-helpers');
Object.defineProperty(global, 'A2A', {
get() {
@@ -45,6 +26,15 @@ Object.defineProperty(global, 'A2A', {
},
});
let testApiInstance;
Object.defineProperty(global, 'TestAdminApi', {
get() {
if (testApiInstance) return testApiInstance;
testApiInstance = new TestingApi();
return testApiInstance;
},
});
Object.defineProperty(global, 'firebase', {
get() {
return jet.module;
@@ -70,5 +60,3 @@ Object.defineProperty(global, 'TestsAPI', {
});
global.isCI = !!process.env.CI;
module.exports.requirePackageTests = requirePackageTests;

View File

@@ -15,47 +15,15 @@
* limitations under the License.
*
*/
// DO NOT USE EXCEPT FOR THIS REACT NATIVE FIREBASE TESTING PROJECT - YOU HAVE
// BEEN WARNED 🙃
require('@react-native-firebase/private-tests-helpers');
global.TestAdminApi = new TestingApi();
require('./globals');
const detox = require('detox');
const jet = require('jet/platform/node');
const { requirePackageTests } = require('./helpers');
const { detox: config } = require('../package.json');
config.configurations['android.emu.debug'].name =
process.env.ANDROID_AVD_NAME || config.configurations['android.emu.debug'].name;
console.log(`Android AVD: ${config.configurations['android.emu.debug'].name}`);
const PACKAGES = [
'app',
'admob',
'dynamic-links',
'iid',
'perf',
'functions',
'analytics',
'remote-config',
'crashlytics',
'ml-natural-language',
// 'ml-vision', TODO - ci is flaky like pastry
'in-app-messaging',
'auth',
'database',
'storage',
'messaging',
'firestore',
];
for (let i = 0; i < PACKAGES.length; i++) {
requirePackageTests(PACKAGES[i]);
}
config.configurations['android.emu.debug'].device.avdName =
process.env.ANDROID_AVD_NAME || config.configurations['android.emu.debug'].device.avdName;
before(async () => {
await detox.init(config);
@@ -63,12 +31,6 @@ before(async () => {
});
beforeEach(async function beforeEach() {
if (jet.context && jet.root && jet.root.setState) {
jet.root.setState({
currentTest: this.currentTest,
});
}
const retry = this.currentTest.currentRetry();
if (retry > 0) {

View File

@@ -1,141 +0,0 @@
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this library except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// TODO move to jet library
// const should = require('should');
//
// xdescribe('jet', () => {
// // beforeEach(async function beforeEach() {
// // await device.reloadReactNative();
// // jet.root.setState({ message: this.currentTest.title });
// // });
//
// it('should provide -> global.jet', async () => {
// should(jet).not.be.undefined();
// return Promise.resolve();
// });
//
// // main react-native module you're testing on
// // in our case react-native-firebase
// it('should provide -> jet.module', async () => {
// should(jet.module).not.be.undefined();
// return Promise.resolve();
// });
//
// // react-native module access
// it('should provide -> jet.rn', () => {
// should(jet.rn).not.be.undefined();
// should(jet.rn.Platform.OS).be.a.String();
// should(jet.rn.Platform.OS).equal(device.getPlatform());
// return Promise.resolve();
// });
//
// // 'global' context of the app's JS environment
// it('should provide -> jet.context', () => {
// should(jet.context).not.be.undefined();
// should(jet.context.setTimeout).be.a.Function();
// should(jet.context.window).be.a.Object();
// // etc ... e.g. __coverage__ is here also if covering
// return Promise.resolve();
// });
//
// // the apps root component
// // allows you to read and set state if required
// xit('should provide -> jet.root', async () => {
// should(jet.root).not.be.undefined();
// should(jet.root.setState).be.a.Function();
// should(jet.root.state).be.a.Object();
//
// // test setting state
// await new Promise(resolve => jet.root.setState({ message: 'hello world' }, resolve));
// should(jet.root.state.message).equal('hello world');
// return Promise.resolve();
// });
//
// // we shim our own reloadReactNative functionality as the detox reloadReactNative built-in
// // hangs often and seems unpredictable - todo: investigate & PR if solution found
// // reloadReactNative is replaced on init with jet.root automatically
// xit('should allow reloadReactNative usage without breaking remote debug', async () => {
// should(jet.reload).be.a.Function();
// // and check it works without breaking anything
// await device.reloadReactNative();
// should(jet.reload).be.a.Function();
// return Promise.resolve();
// });
//
// // TODO flakey - "This method must not be called before the JS thread is created"
// // https://github.com/facebook/react-native/blob/master/React/CxxBridge/RCTCxxBridge.mm
// xit('should allow launchApp usage without breaking remote debug', async () => {
// should(jet.module).not.be.undefined();
// should(jet.reload).be.a.Function();
// should(jet.rn).not.be.undefined();
// should(jet.rn.Platform.OS).be.a.String();
// should(jet.rn.Platform.OS).equal(device.getPlatform());
//
// await device.launchApp({ newInstance: true });
//
// should(jet.module).not.be.undefined();
// should(jet.reload).be.a.Function();
// should(jet.rn).not.be.undefined();
// should(jet.rn.Platform.OS).be.a.String();
// should(jet.rn.Platform.OS).equal(device.getPlatform());
// return Promise.resolve();
// });
//
// // TIMERS
// it('timing.setTimeout', cb => {
// const start = Date.now();
// jet.context.setTimeout(() => {
// const timeTaken = Date.now() - start;
// if (timeTaken >= 50) cb();
// else cb(new Error('setTimeout fn called too soon.'));
// }, 50);
// });
//
// it('timing.setInterval', cb => {
// let times = 0;
// const start = Date.now();
//
// const interval = jet.context.setInterval(() => {
// const timeTaken = Date.now() - start;
//
// times++;
// jet.context.clearInterval(interval);
// if (times >= 2) {
// return cb(new Error('Interval did not cancel correctly.'));
// }
//
// if (timeTaken < 50) {
// return cb(new Error('setInterval fn called too soon.'));
// }
//
// return jet.context.setTimeout(cb, 100);
// }, 50);
// });
//
// it('timing.setImmediate', cb => {
// jet.context.setImmediate(() => cb());
// });
//
// it('timing.requestIdleCallback', cb => {
// jet.context.requestIdleCallback(() => cb());
// });
//
// it('timing.requestAnimationFrame', cb => {
// jet.context.requestAnimationFrame(() => cb());
// });
// });

View File

@@ -1,8 +1,46 @@
--recursive
--timeout 260000
--timeout 360000
--reporter spec
--slow 2000
--retries 5
--bail
--exit
--require node_modules/jet/platform/node
../packages/app/e2e/*.e2e.js
../packages/analytics/e2e/*.e2e.js
../packages/auth/e2e/*.e2e.js
# TODO a lot of these failing on CI - might be an API rate limit change
# ../packages/admob/e2e/*.e2e.js
../packages/crashlytics/e2e/*.e2e.js
../packages/dynamic-links/e2e/*.e2e.js
../packages/iid/e2e/*.e2e.js
../packages/perf/e2e/*.e2e.js
../packages/functions/e2e/*.e2e.js
../packages/remote-config/e2e/*.e2e.js
../packages/ml-natural-language/e2e/*.e2e.js
# TODO - ci crashing ios
# ../packages/ml-vision/e2e/*.e2e.js
../packages/in-app-messaging/e2e/*.e2e.js
../packages/database/e2e/*.e2e.js
# TODO crashing - error codes are wrong
# ../packages/storage/e2e/*.e2e.js
../packages/messaging/e2e/*.e2e.js
../packages/firestore/e2e/*.e2e.js

View File

@@ -1,7 +1,7 @@
platform :ios, '9.0'
# Allow using RNFirebase as static frameworks
$RNFirebaseAsStaticFramework = true
$RNFirebaseAsStaticFramework = false
# Version override testing
# $FirebaseSDKVersion = '6.15.0'
@@ -11,7 +11,7 @@ $RNFirebaseAsStaticFramework = true
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'testing' do
use_frameworks!
# use_frameworks!
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"

View File

@@ -463,7 +463,7 @@ PODS:
- GTMSessionFetcher/Core (1.3.1)
- GTMSessionFetcher/Full (1.3.1):
- GTMSessionFetcher/Core (= 1.3.1)
- Jet (0.4.4):
- Jet (0.6.6-0):
- React
- leveldb-library (1.22)
- nanopb (0.3.9011):
@@ -1024,7 +1024,7 @@ SPEC CHECKSUMS:
"gRPC-C++": 9dfe7b44821e7b3e44aacad2af29d2c21f7cde83
gRPC-Core: c9aef9a261a1247e881b18059b84d597293c9947
GTMSessionFetcher: cea130bbfe5a7edc8d06d3f0d17288c32ffe9925
Jet: 28e2deb607658bd5c5d24e3fcb926bb3f7daf59e
Jet: 84fd0e2e9d49457fc04bc79b5d8857737a01c507
leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
PersonalizedAdConsent: 4b87320b7a0f22576bec530ae3b7adba88a24c78
@@ -1048,25 +1048,25 @@ SPEC CHECKSUMS:
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
RNFBAdMob: c90a7b2d7512ce1513b7a0bb03544db9d48bb504
RNFBAnalytics: 197567b75dab41ed36dde10678aa1b54b8cf4db4
RNFBApp: ae8fe642e3e457a9a417f1cf825a22de6bc5e94d
RNFBAuth: 8309add6fb9d1aca22be498fd94184c03e81cd4e
RNFBCrashlytics: 99158b399a5403317c531ddef4b8cf36014e577c
RNFBDatabase: e2b8aa9343cb2f664ef723092f08ebf08d324060
RNFBDynamicLinks: fae51a8bad224af8b3686c1dff54c6ca0ed9099e
RNFBFirestore: 3c08fa41357ad38b8f8fac1dab8f4fd5f2fce6bf
RNFBFunctions: 7639d07925279adfb410c8c07ead93741b7b8e90
RNFBIid: cc814158331e06677333fae582d1916e007c6dae
RNFBInAppMessaging: b7679313f89ea742b75a399d1330933c2b8915f8
RNFBMessaging: 82a9c9bacbf5fff18bdc42e731b5fe7eef2bd3f2
RNFBMLNaturalLanguage: 5da2718f4092c83e92c9eabb9392d4c041094f44
RNFBMLVision: dfcc9c24a2fc66dccef21f6838505debd8682645
RNFBPerf: 1f0d7e74ec299a23f69afcd0d2a96f904fc56ebb
RNFBRemoteConfig: 9b294a6065a2f1b94be7c3421f044aeb20f4c6c3
RNFBStorage: 89bc6053f77b4272a8fad45d9558a8853d649246
RNFBAdMob: fb4566703243981ef0a381c0cb06e65a9f567061
RNFBAnalytics: 2a5adf3a6331dfd232ac9661108e491b832be6e9
RNFBApp: 69781cf10ce41f6f6db789e6264dd80119ef2fb7
RNFBAuth: 50fcc7826344dc96caad8bc4f5b40a64904297b8
RNFBCrashlytics: f6630b1cfa1fbac5348205232709ac779369d9e7
RNFBDatabase: 393536c2bd82bd11de82795c2d5893f04d5bf587
RNFBDynamicLinks: f4da0bc5a4b071069b131d3c91ca35db568a9ba5
RNFBFirestore: 69e59e5266927857fa3629715111ee65f4de1cd0
RNFBFunctions: 42eb4afb067cd496523a24678b7a582262f6ecc5
RNFBIid: 75af4c2986903b676b15a60f2632e9c96f1be224
RNFBInAppMessaging: a1f269d1c85296d59f4e3ed36dc22af19e62d405
RNFBMessaging: 805710731a2b616030514f6f416e8787de521f41
RNFBMLNaturalLanguage: 1547525306a5370365c630c9e4611f6512b4d1e7
RNFBMLVision: b369b6829bd85d5c95d58f2c00372a02ce653b5d
RNFBPerf: 65787352c484138ae47d963c9111a6181914f70a
RNFBRemoteConfig: a09169a1264aa10c84a22841f7e8ef262d52c796
RNFBStorage: 24097a1d18534b9c3559f862b8d18365cd573c2c
Yoga: 3ebccbdd559724312790e7742142d062476b698e
PODFILE CHECKSUM: ed5de22e2fc0db3523aadec25cc4c586cbec2201
PODFILE CHECKSUM: 8fd199b6299b1ecf6f4e79f3d682905870c071da
COCOAPODS: 1.8.4
COCOAPODS: 1.9.1

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 53;
objects = {
/* Begin PBXBuildFile section */
@@ -12,8 +12,8 @@
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
271CB185206AFCD300EBADF4 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 271CB184206AFCD300EBADF4 /* GoogleService-Info.plist */; };
27CE6A36224923D200222E16 /* remote_config_resource_test.plist in Resources */ = {isa = PBXBuildFile; fileRef = 27CE6A35224923D200222E16 /* remote_config_resource_test.plist */; };
284DCD91B1011C25D9DA09A8 /* Pods_testing.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D15F75BA0B41F9EFCF9CBB06 /* Pods_testing.framework */; };
3323F06104C7189BEC46D8B5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3323FFA47718EA67C36AD776 /* Images.xcassets */; };
3F7DAAFAFAE497334390E087 /* libPods-testing.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84952B7CED519DB4296F49CC /* libPods-testing.a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -44,8 +44,8 @@
30F8459A53F04DD0B22777D1 /* testing.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; path = testing.xcodeproj; sourceTree = "<group>"; };
3323FFA47718EA67C36AD776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = testing/Images.xcassets; sourceTree = "<group>"; };
566425D74294B2ACC4EE306F /* Pods-testing.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testing.debug.xcconfig"; path = "Pods/Target Support Files/Pods-testing/Pods-testing.debug.xcconfig"; sourceTree = "<group>"; };
84952B7CED519DB4296F49CC /* libPods-testing.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-testing.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9C7918F28F80D1F2E4DC3B97 /* Pods-testing.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testing.release.xcconfig"; path = "Pods/Target Support Files/Pods-testing/Pods-testing.release.xcconfig"; sourceTree = "<group>"; };
D15F75BA0B41F9EFCF9CBB06 /* Pods_testing.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_testing.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -53,7 +53,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
284DCD91B1011C25D9DA09A8 /* Pods_testing.framework in Frameworks */,
3F7DAAFAFAE497334390E087 /* libPods-testing.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -102,7 +102,7 @@
588120300B16002F2CF411A2 /* Frameworks */ = {
isa = PBXGroup;
children = (
D15F75BA0B41F9EFCF9CBB06 /* Pods_testing.framework */,
84952B7CED519DB4296F49CC /* libPods-testing.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -164,7 +164,6 @@
C8C3C54345A6A1BEDB5A0F51 /* [CP] Copy Pods Resources */,
2DEDEB3AED1121B4052E9EC8 /* [CP-User] [RNFB] Core Configuration */,
EA9445F776F5CEB60B0182F7 /* [CP-User] [RNFB] Crashlytics Configuration */,
859072D199B5176B3D7ED63C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -181,6 +180,7 @@
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = Invertase;
TargetAttributes = {
@@ -303,23 +303,6 @@
shellPath = /bin/bash;
shellScript = "if [ -n \"$DEPLOY_DETOX_FRAMEWORK\" ]; then\nmkdir -p \"${BUILT_PRODUCTS_DIR}\"/\"${FRAMEWORKS_FOLDER_PATH}\"\ncp -r \"${PROJECT_DIR}\"/../node_modules/detox/Detox.framework \"${BUILT_PRODUCTS_DIR}\"/\"${FRAMEWORKS_FOLDER_PATH}\"\nfi\n";
};
859072D199B5176B3D7ED63C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-testing/Pods-testing-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-testing/Pods-testing-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-testing/Pods-testing-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C8C3C54345A6A1BEDB5A0F51 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@@ -6,20 +6,6 @@
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
@@ -34,20 +20,6 @@
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "exampleTests.xctest"
BlueprintName = "exampleTests"
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
@@ -65,16 +37,6 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "exampleTests.xctest"
BlueprintName = "exampleTests"
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction

View File

@@ -3,7 +3,7 @@
LastUpgradeVersion = "1140"
version = "1.7">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
@@ -20,34 +20,6 @@
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "testing.app"
BlueprintName = "testing"
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "exampleTests.xctest"
BlueprintName = "exampleTests"
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
@@ -65,16 +37,6 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "exampleTests.xctest"
BlueprintName = "exampleTests"
ReferencedContainer = "container:testing.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction

View File

@@ -31,7 +31,7 @@ const firebaseModules = readdirSync(packagesDir)
const config = {
projectRoot: __dirname,
resolver: {
useWatchman: !process.env.TEAMCITY_VERSION,
useWatchman: !process.env.CI,
blackListRE: blacklist([
/.*\/__fixtures__\/.*/,
/.*\/template\/project\/node_modules\/react-native\/.*/,
@@ -62,6 +62,9 @@ const config = {
},
),
},
server: {
runInspectorProxy: !process.env.CI,
},
watchFolders: [resolve(__dirname, '.'), ...firebaseModules],
};

18
tests/nyc.config.js Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
'check-coverage': false,
lines: 95,
statements: 95,
functions: 95,
branches: 95,
include: ['packages/*/lib/**/*.js'],
exclude: [
'**/common/lib/**',
'**/lib/handlers.js',
'**/internal/registry/**',
'packages/database/lib/DatabaseSyncTree.js',
],
cwd: '..',
sourceMap: false,
instrument: false,
reporter: ['lcov', 'html', 'text-summary'],
};

View File

@@ -29,47 +29,19 @@
"react-native": "0.62.2"
},
"devDependencies": {
"@react-native-firebase/private-tests-helpers": "^0.0.13",
"@react-native-firebase/private-tests-helpers": "0.0.13",
"a2a": "^0.2.0",
"babel-plugin-istanbul": "^5.2.0",
"babel-plugin-istanbul": "^6.0.0",
"detox": "16.2.0",
"jet": "^0.6.2-0",
"jet": "^0.6.6-0",
"mocha": "^6.1.4",
"nyc": "^14.1.1",
"nyc": "^15.0.1",
"react-native-port-patcher": "^1.0.4",
"patch-package": "^6.2.2",
"require-all": "3.0.0",
"should": "^13.2.3",
"should-sinon": "0.0.6",
"sinon": "^9.0.2"
},
"nyc": {
"check-coverage": false,
"lines": 95,
"statements": 95,
"functions": 95,
"branches": 95,
"include": [
"packages/**"
],
"exclude": [
"node_modules",
"**/common/lib/**",
"**/lib/handlers.js",
"**/internal/registry/**",
"packages/**/node_modules/**",
"packages/database/lib/DatabaseSyncTree.js"
],
"cwd": "..",
"all": true,
"sourceMap": false,
"instrument": false,
"reporter": [
"lcov",
"html",
"text-summary"
]
},
"detox": {
"test-runner": "mocha",
"specs": "e2e",
@@ -80,23 +52,23 @@
"build": "xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES -quiet | xcpretty -k",
"type": "ios.simulator",
"device": {
"type": "iPhone X"
"type": "iPhone 8"
}
},
"ios.ci": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/testing.app",
"build": "xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES \"RCT_METRO_PORT=$RCT_METRO_PORT\" | xcpretty -k",
"build": "xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES | xcpretty -k",
"type": "ios.simulator",
"device": {
"type": "iPhone X"
"type": "iPhone 11"
}
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "pushd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false && popd",
"build": "pushd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && popd",
"type": "android.emulator",
"device": {
"avdName": "TestingAVD_29"
"avdName": "TestingAVD"
}
},
"ios.sim.release": {