Skip to content
This repository was archived by the owner on Dec 3, 2022. It is now read-only.

Commit 4ca7a29

Browse files
committed
use ts lib in tests instead of dist js output
1 parent e6aca3d commit 4ca7a29

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/__tests__/Hooks.test.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as React from 'react';
22
import { useState } from 'react';
33
import * as renderer from 'react-test-renderer';
4-
// @ts-ignore
5-
import { createSwitchNavigator } from '@react-navigation/core';
64

75
import {
6+
createSwitchNavigator,
87
createAppContainer,
98
NavigationEventPayload,
109
NavigationActions,
@@ -17,12 +16,14 @@ import {
1716
useNavigationKey,
1817
useNavigationEvents,
1918
useFocusState,
20-
// @ts-ignore
21-
} from '../../dist/module/Hooks';
19+
} from '../Hooks';
20+
21+
type DetailsScreenParams = { from: string };
2222

2323
const HomeScreen = () => {
2424
const { navigate } = useNavigation();
25-
return navigate('Details', { from: 'Home' });
25+
const params: DetailsScreenParams = { from: 'Home' };
26+
return navigate('Details', params);
2627
};
2728

2829
const DetailsScreen = () => {
@@ -115,13 +116,7 @@ describe('AppNavigator2 Stack', () => {
115116
navigationContainer = renderer.create(<App />);
116117
});
117118

118-
const eventTypes = [
119-
'willFocus',
120-
'didFocus',
121-
'willBlur',
122-
'didBlur',
123-
'action'
124-
];
119+
const eventTypes = ['willFocus', 'didFocus', 'willBlur', 'didBlur', 'action'];
125120

126121
it('usenNavigationState: Get current route name', () => {
127122
const children = navigationContainer.toJSON().children;

0 commit comments

Comments
 (0)