Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: dependency updates, related fixes #4711

Merged
merged 6 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ module.exports = {
'no-underscore-dangle': 'off',
'no-use-before-define': 0,
'import/no-unresolved': 0,
'@typescript-eslint/ban-ts-comment': 'off', // keep it professional when you use them though please
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-function': 'off',
// off for validation tests
Expand All @@ -45,7 +47,6 @@ module.exports = {
'mocha/no-top-level-hooks': 'off', // potentially has value if anyone wants to refactor
'mocha/no-hooks-for-single-case': 'off', // potentially has value
'mocha/no-setup-in-describe': 'off', // potentially has value, large refactor here though

},
globals: {
__DEV__: true,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run lint
run: yarn lint
- name: Save Code Linting Report JSON
run: yarn run lint:report
run: yarn lint:report
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/[email protected]
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Lint
run: yarn run tsc:compile
run: yarn tsc:compile

typedoc:
name: TypeDoc Generation
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/tests_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ jobs:
shell: bash

- name: Build Android App
run: cd tests/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: cd tests/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug -Dorg.gradle.daemon=false

- name: Pre-fetch Javascript bundle
# Prebuild the bundle so that's fast when the app starts.
run: |
nohup yarn run tests:packager:jet &
nohup yarn tests:packager:jet &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
Expand Down Expand Up @@ -296,7 +301,7 @@ jobs:

- name: Pre-fetch Javascript bundle
run: |
nohup yarn run tests:packager:jet &
nohup yarn tests:packager:jet &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
max_attempts: 3
command: yarn --no-audit --prefer-offline
- name: Jest
run: yarn run tests:jest-coverage
run: yarn tests:jest-coverage
- name: Submit Coverage
# This can fail on timeouts etc, wrap with retry
uses: nick-invision/retry@v2
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,30 @@
"format:markdown": "prettier --write \"docs/**/*.md\""
},
"devDependencies": {
"@babel/preset-env": "7.9.5",
"@babel/preset-flow": "7.9.0",
"@types/jest": "^25.2.1",
"@babel/preset-env": "7.12.11",
"@babel/preset-flow": "7.12.1",
"@types/jest": "^26.0.19",
"@types/react": "^16.9.49",
"@types/react-native": "^0.62.0",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@types/react-native": "^0.63.42",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"codecov": "^3.6.5",
"conventional-changelog-cli": "^2.0.34",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.5.0",
"cross-env": "^7.0.3",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.19.0",
"genversion": "^2.2.0",
"inquirer": "^7.1.0",
"jest": "^25.5.1",
"lerna": "3.20.2",
"prettier": "^1.19.1",
"jest": "^26.6.3",
"lerna": "3.22.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.3",
"ts-jest": "^25.4.0",
"typescript": "^3.8.3"
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},
"resolutions": {
"@types/react": "^16.9.49"
Expand Down
2 changes: 1 addition & 1 deletion packages/admob/RNFBAdMob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pod::Spec.new do |s|
s.authors = "Invertase Limited"
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
s.social_media_url = 'http://twitter.com/invertaseio'
s.ios.deployment_target = "9.0"
s.ios.deployment_target = "10.0"
s.source_files = 'ios/**/*.{h,m}'

# React Native dependencies
Expand Down
22 changes: 11 additions & 11 deletions packages/admob/__tests__/admob.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { firebase, FirebaseAdMobTypes } from '../lib';

describe('Admob', function() {
describe('namespace', function() {
it('accessible from firebase.app()', function() {
describe('Admob', function () {
describe('namespace', function () {
it('accessible from firebase.app()', function () {
const app = firebase.app();
expect(app.admob).toBeDefined();
expect(app.admob().app).toEqual(app);
});
});

describe('setRequestConfiguration()', function() {
it('throws if config is not an object', function() {
describe('setRequestConfiguration()', function () {
it('throws if config is not an object', function () {
// @ts-ignore
expect(() => firebase.admob().setRequestConfiguration('123')).toThrowError(
"firebase.admob().setRequestConfiguration(*) 'requestConfiguration' expected an object value",
);
});

describe('maxAdContentRating', function() {
it('throws if maxAdContentRating is invalid', function() {
describe('maxAdContentRating', function () {
it('throws if maxAdContentRating is invalid', function () {
expect(() =>
firebase.admob().setRequestConfiguration({
maxAdContentRating: 'Y' as FirebaseAdMobTypes.MaxAdContentRating[keyof FirebaseAdMobTypes.MaxAdContentRating],
Expand All @@ -29,8 +29,8 @@ describe('Admob', function() {
});
});

describe('tagForChildDirectedTreatment', function() {
it('throws if tagForChildDirectedTreatment not a boolean', function() {
describe('tagForChildDirectedTreatment', function () {
it('throws if tagForChildDirectedTreatment not a boolean', function () {
expect(() =>
firebase.admob().setRequestConfiguration({
// @ts-ignore
Expand All @@ -42,8 +42,8 @@ describe('Admob', function() {
});
});

describe('tagForUnderAgeOfConsent', function() {
it('throws if tagForUnderAgeOfConsent not a boolean', function() {
describe('tagForUnderAgeOfConsent', function () {
it('throws if tagForUnderAgeOfConsent not a boolean', function () {
expect(() =>
firebase.admob().setRequestConfiguration({
// @ts-ignore
Expand Down
10 changes: 5 additions & 5 deletions packages/admob/__tests__/consent.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { AdsConsent } from '../lib';

describe('Admob AdsConsent', function() {
describe('requestInfoUpdate', function() {
it('throws if publisherIds is not an array', function() {
describe('Admob AdsConsent', function () {
describe('requestInfoUpdate', function () {
it('throws if publisherIds is not an array', function () {
// @ts-ignore
expect(() => AdsConsent.requestInfoUpdate('pub-123')).toThrowError(
"firebase.admob.AdsConsent.requestInfoUpdate(*) 'publisherIds' expected an array of string values.",
);
});

it('throws if publisherIds is empty array', function() {
it('throws if publisherIds is empty array', function () {
expect(() => AdsConsent.requestInfoUpdate([])).toThrowError(
"firebase.admob.AdsConsent.requestInfoUpdate(*) 'publisherIds' list of publisher IDs cannot be empty.",
);
});

it('throws if publisherIds contains non-string values', function() {
it('throws if publisherIds contains non-string values', function () {
// @ts-ignore
expect(() => AdsConsent.requestInfoUpdate(['foo', 123])).toThrowError(
"firebase.admob.AdsConsent.requestInfoUpdate(*) 'publisherIds[1]' expected a string value.",
Expand Down
20 changes: 10 additions & 10 deletions packages/admob/__tests__/interstitial.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { InterstitialAd } from '../lib';

describe('Admob Interstitial', function() {
describe('createForAdRequest', function() {
it('throws if adUnitId is invalid', function() {
describe('Admob Interstitial', function () {
describe('createForAdRequest', function () {
it('throws if adUnitId is invalid', function () {
// @ts-ignore
expect(() => InterstitialAd.createForAdRequest(123)).toThrowError(
"'adUnitId' expected an string value",
);
});

it('throws if requestOptions are invalid', function() {
it('throws if requestOptions are invalid', function () {
// @ts-ignore
expect(() => InterstitialAd.createForAdRequest('123', 123)).toThrowError(
"firebase.admob() InterstitialAd.createForAdRequest(_, *) 'options' expected an object value.",
);
});

// has own tests
it('returns a new instance', function() {
it('returns a new instance', function () {
const i = InterstitialAd.createForAdRequest('abc');
expect(i.constructor.name).toEqual('InterstitialAd');
expect(i.adUnitId).toEqual('abc');
expect(i.loaded).toEqual(false);
});

describe('show', function() {
it('throws if showing before loaded', function() {
describe('show', function () {
it('throws if showing before loaded', function () {
const i = InterstitialAd.createForAdRequest('abc');

expect(() => i.show()).toThrowError(
Expand All @@ -34,15 +34,15 @@ describe('Admob Interstitial', function() {
});
});

describe('onAdEvent', function() {
it('throws if handler is not a function', function() {
describe('onAdEvent', function () {
it('throws if handler is not a function', function () {
const i = InterstitialAd.createForAdRequest('abc');

// @ts-ignore
expect(() => i.onAdEvent('foo')).toThrowError("'handler' expected a function");
});

it('returns an unsubscriber function', function() {
it('returns an unsubscriber function', function () {
const i = InterstitialAd.createForAdRequest('abc');
const unsub = i.onAdEvent(() => {});
expect(unsub).toBeDefined();
Expand Down
28 changes: 14 additions & 14 deletions packages/admob/e2e/admob.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
*
*/

describe('admob()', function() {
describe('namespace', function() {
it('accessible from firebase.app()', function() {
describe('admob()', function () {
describe('namespace', function () {
it('accessible from firebase.app()', function () {
const app = firebase.app();
should.exist(app.admob);
app.admob().app.should.equal(app);
});
});

describe('setRequestConfiguration()', function() {
it('throws if config is not an object', function() {
describe('setRequestConfiguration()', function () {
it('throws if config is not an object', function () {
try {
firebase.admob().setRequestConfiguration('123');
return Promise.reject(new Error('Did not throw Error.'));
Expand All @@ -35,8 +35,8 @@ describe('admob()', function() {
}
});

describe('maxAdContentRating', function() {
it('throws if maxAdContentRating is invalid', function() {
describe('maxAdContentRating', function () {
it('throws if maxAdContentRating is invalid', function () {
try {
firebase.admob().setRequestConfiguration({
maxAdContentRating: 'Y',
Expand All @@ -48,15 +48,15 @@ describe('admob()', function() {
}
});

it('accepts a age rating', async function() {
it('accepts a age rating', async function () {
await firebase.admob().setRequestConfiguration({
maxAdContentRating: firebase.admob.MaxAdContentRating.G,
});
});
});

describe('tagForChildDirectedTreatment', function() {
it('throws if tagForChildDirectedTreatment not a boolean', function() {
describe('tagForChildDirectedTreatment', function () {
it('throws if tagForChildDirectedTreatment not a boolean', function () {
try {
firebase.admob().setRequestConfiguration({
tagForChildDirectedTreatment: 'true',
Expand All @@ -70,15 +70,15 @@ describe('admob()', function() {
}
});

it('sets the value', async function() {
it('sets the value', async function () {
await firebase.admob().setRequestConfiguration({
tagForChildDirectedTreatment: false,
});
});
});

describe('tagForUnderAgeOfConsent', function() {
it('throws if tagForUnderAgeOfConsent not a boolean', function() {
describe('tagForUnderAgeOfConsent', function () {
it('throws if tagForUnderAgeOfConsent not a boolean', function () {
try {
firebase.admob().setRequestConfiguration({
tagForUnderAgeOfConsent: 'false',
Expand All @@ -92,7 +92,7 @@ describe('admob()', function() {
}
});

it('sets the value', async function() {
it('sets the value', async function () {
await firebase.admob().setRequestConfiguration({
tagForUnderAgeOfConsent: false,
});
Expand Down
Loading