Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaSvietlova committed Jan 13, 2025
1 parent 0784f9f commit e5fb3c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
createPerformancePaintTimingFake
} from '../utilities'
import MockRoutingProvider from '../utilities/mock-routing-provider'
import type { AppState } from '@bugsnag/core-performance/dist/types/core'
import type { AppState } from '../../../../core/lib/core'

jest.useFakeTimers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button, View } from 'react-native'
import { Navigation } from 'react-native-navigation'
import { CompleteNavigation } from '../lib/CompleteNavigation'
import ReactNativeNavigationPlugin from '../lib/react-native-navigation-plugin'
import type { AppState } from '../../core/lib/core'

jest.mock('react-native-navigation')

Expand All @@ -31,7 +32,11 @@ function createMockClient (plugin: ReactNativeNavigationPlugin) {

describe('CompleteNavigation', () => {
it('calls the appropriate methods on mount', () => {
const plugin = new ReactNativeNavigationPlugin(Navigation)
let appState: AppState

Check failure on line 35 in packages/plugin-react-native-navigation/__tests__/CompleteNavigation.test.tsx

View workflow job for this annotation

GitHub Actions / linting

'appState' is assigned a value but never used
const setAppState = jest.fn((state: AppState) => {
appState = state
})
const plugin = new ReactNativeNavigationPlugin(Navigation, setAppState)
createMockClient(plugin)

render(
Expand All @@ -48,7 +53,11 @@ describe('CompleteNavigation', () => {
})

it('calls the appropriate methods on unmount', () => {
const plugin = new ReactNativeNavigationPlugin(Navigation)
let appState: AppState

Check failure on line 56 in packages/plugin-react-native-navigation/__tests__/CompleteNavigation.test.tsx

View workflow job for this annotation

GitHub Actions / linting

'appState' is assigned a value but never used
const setAppState = jest.fn((state: AppState) => {
appState = state
})
const plugin = new ReactNativeNavigationPlugin(Navigation, setAppState)
createMockClient(plugin)

function TestApp () {
Expand All @@ -75,7 +84,11 @@ describe('CompleteNavigation', () => {
})

it('calls the appropriate method when the "on" condition changes to true', () => {
const plugin = new ReactNativeNavigationPlugin(Navigation)
let appState: AppState

Check failure on line 87 in packages/plugin-react-native-navigation/__tests__/CompleteNavigation.test.tsx

View workflow job for this annotation

GitHub Actions / linting

'appState' is assigned a value but never used
const setAppState = jest.fn((state: AppState) => {
appState = state
})
const plugin = new ReactNativeNavigationPlugin(Navigation, setAppState)
createMockClient(plugin)

function TestApp () {
Expand Down

0 comments on commit e5fb3c7

Please sign in to comment.