Skip to content

Commit 29447aa

Browse files
committed
test(types): remove @types/jest and use jest built-in types
requires importing global symbols directly, but removes a dep
1 parent ed00363 commit 29447aa

File tree

19 files changed

+33
-13
lines changed

19 files changed

+33
-13
lines changed

jest.setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as ReactNative from 'react-native';
2+
import { jest } from '@jest/globals';
23

34
jest.doMock('react-native', () => {
45
return Object.setPrototypeOf(

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@babel/preset-env": "^7.19.4",
5555
"@octokit/core": "^4.1.0",
5656
"@tsconfig/node12": "^1.0.11",
57-
"@types/jest": "28.1.2",
5857
"@types/react": "^17.0.48",
5958
"@types/react-native": "^0.67.12",
6059
"@typescript-eslint/eslint-plugin": "^5.40.1",

packages/analytics/__tests__/analytics.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it, xit } from '@jest/globals';
2+
13
import { firebase } from '../lib';
24

35
describe('Analytics', function () {

packages/app-check/__tests__/appcheck.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from '@jest/globals';
2+
13
import { firebase } from '../lib';
24

35
describe('appCheck()', function () {

packages/app-distribution/__tests__/app-distribution.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from '@jest/globals';
2+
13
import { firebase } from '../lib';
24

35
describe('appDistribution()', function () {

packages/app/plugin/__tests__/androidPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'fs/promises';
22
import path from 'path';
3+
import { beforeAll, describe, expect, it } from '@jest/globals';
34

45
import { applyPlugin } from '../src/android/applyPlugin';
56
import { setBuildscriptDependency } from '../src/android/buildscriptDependency';

packages/app/plugin/__tests__/iosPlugin.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { IOSConfig } from '@expo/config-plugins';
22
import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
33
import fs from 'fs/promises';
44
import path from 'path';
5+
import { beforeEach, describe, expect, it, jest } from '@jest/globals';
56

67
import { modifyAppDelegateAsync, modifyObjcAppDelegate } from '../src/ios/appDelegate';
78

@@ -57,7 +58,7 @@ describe('Config Plugin iOS Tests', function () {
5758
});
5859

5960
it('detects Objective-C++ AppDelegate.mm', async function () {
60-
jest.spyOn(fs, 'writeFile').mockImplementation();
61+
jest.spyOn(fs, 'writeFile').mockImplementation(async () => {});
6162

6263
const appDelegatePath = path.join(__dirname, './fixtures/AppDelegate_sdk45.mm');
6364
const appDelegateFileInfo = IOSConfig.Paths.getFileInfo(
@@ -74,7 +75,7 @@ describe('Config Plugin iOS Tests', function () {
7475
});
7576

7677
it("doesn't support Swift AppDelegate", async function () {
77-
jest.spyOn(fs, 'writeFile').mockImplementation();
78+
jest.spyOn(fs, 'writeFile').mockImplementation(async () => {});
7879

7980
const appDelegateFileInfo: AppDelegateProjectFile = {
8081
path: '.',

packages/auth/__tests__/auth.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from '@jest/globals';
2+
13
import auth, { firebase } from '../lib';
24

35
describe('Auth', function () {

packages/crashlytics/__tests__/crashlytics.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from '@jest/globals';
2+
13
import { firebase } from '../lib';
24

35
describe('Crashlytics', function () {

packages/crashlytics/plugin/__tests__/androidPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'fs/promises';
22
import path from 'path';
3+
import { beforeAll, describe, expect, it } from '@jest/globals';
34

45
import { applyPlugin } from '../src/android/applyPlugin';
56
import { setBuildscriptDependency } from '../src/android/buildscriptDependency';

0 commit comments

Comments
 (0)