mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
tests(functions): jest migration (#3587)
* Updated functions jest tests * Additonal tests added for httpcallable * tests(functions): updated try catch tests * Update .eslintrc.js Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
This commit is contained in:
@@ -38,7 +38,8 @@ module.exports = {
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/camelcase': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/ban-ts-ignore': 'warn',
|
||||
// off for validation tests
|
||||
'@typescript-eslint/ban-ts-ignore': 'off',
|
||||
},
|
||||
globals: {
|
||||
__DEV__: true,
|
||||
|
||||
@@ -25,16 +25,12 @@ describe('Cloud Functions', () => {
|
||||
|
||||
describe('httpcallable()', () => {
|
||||
it('throws an error with an incorrect timeout', () => {
|
||||
try {
|
||||
const app = firebase.app();
|
||||
const app = firebase.app();
|
||||
|
||||
// @ts-ignore
|
||||
app.functions().httpsCallable('example', { timeout: 'test' });
|
||||
return Promise.reject(new Error('Did not throw'));
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual('HttpsCallableOptions.timeout expected a Number in milliseconds');
|
||||
return Promise.resolve();
|
||||
}
|
||||
// @ts-ignore
|
||||
expect(() => app.functions().httpsCallable('example', { timeout: 'test' })).toThrow(
|
||||
'HttpsCallableOptions.timeout expected a Number in milliseconds',
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user