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

use @jest/globals #459

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions jest/mock.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* global jest */
import { jest } from '@jest/globals';
import React, { useContext } from 'react';
import type { Metrics } from '../src/SafeArea.types';
import type { SafeAreaProviderProps } from '../src/SafeAreaContext';
import type { SafeAreaProviderProps, SafeAreaInsetsContext, SafeAreaFrameContext } from '../src/SafeAreaContext';

const MOCK_INITIAL_METRICS: Metrics = {
frame: {
Expand All @@ -18,7 +19,7 @@ const MOCK_INITIAL_METRICS: Metrics = {
},
};

const RNSafeAreaContext = jest.requireActual('react-native-safe-area-context');
const RNSafeAreaContext = jest.requireActual<{SafeAreaInsetsContext:typeof SafeAreaInsetsContext, SafeAreaFrameContext: typeof SafeAreaFrameContext}>('react-native-safe-area-context');

export default {
...RNSafeAreaContext,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
},
"devDependencies": {
"@commitlint/config-conventional": "^17.6.1",
"@jest/globals": "^29.7.0",
"@react-native-community/eslint-config": "^3.2.0",
"@react-native/eslint-plugin-specs": "^0.73.0",
"@release-it/conventional-changelog": "^5.1.1",
"@types/jest": "^29.5.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@types/react-test-renderer": "^18.0.0",
Expand Down
Loading
Loading