Skip to content

Commit cf676e8

Browse files
committed
Distinguish between external and internal imports in tests
1 parent 1269bf4 commit cf676e8

13 files changed

+31
-31
lines changed

test/components/Provider.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import * as rtl from '@testing-library/react'
44
import type { Dispatch, JSX } from 'react'
55
import React, { Component } from 'react'
6+
import type { ReactReduxContextValue } from 'react-redux'
7+
import { Provider, ReactReduxContext, connect } from 'react-redux'
68
import type { Store } from 'redux'
79
import { createStore } from 'redux'
8-
import type { ReactReduxContextValue } from '../../src'
9-
import { Provider, ReactReduxContext, connect } from '../../src/index'
1010

1111
import * as ReactDOM from 'react-dom'
1212

test/components/connect.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*eslint-disable react/prop-types*/
22

33
import * as rtl from '@testing-library/react'
4-
import type { Dispatch, ElementType, MouseEvent, ReactNode, JSX } from 'react'
4+
import type { Dispatch, ElementType, JSX, MouseEvent, ReactNode } from 'react'
55
import React, { Component } from 'react'
6+
import type { ReactReduxContextValue } from 'react-redux'
7+
import { Provider as ProviderMock, connect } from 'react-redux'
68
import type {
79
Action,
810
AnyAction,
@@ -12,8 +14,6 @@ import type {
1214
UnknownAction,
1315
} from 'redux'
1416
import { applyMiddleware, createStore } from 'redux'
15-
import type { ReactReduxContextValue } from '../../src/index'
16-
import { Provider as ProviderMock, connect } from '../../src/index'
1717

1818
const IS_REACT_18 = React.version.startsWith('18')
1919

test/components/hooks.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import * as rtl from '@testing-library/react'
44
import React from 'react'
5+
import { Provider as ProviderMock, connect } from 'react-redux'
56
import type { AnyAction } from 'redux'
67
import { createStore } from 'redux'
7-
import { Provider as ProviderMock, connect } from '../../src/index'
88

99
const IS_REACT_18 = React.version.startsWith('18')
1010

test/hooks/hooks.withTypes.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Action, ThunkAction } from '@reduxjs/toolkit'
22
import { configureStore, createAsyncThunk, createSlice } from '@reduxjs/toolkit'
3-
import { useDispatch, useSelector, useStore } from '../../src'
3+
import { useDispatch, useSelector, useStore } from 'react-redux'
44

55
export interface CounterState {
66
counter: number

test/hooks/useDispatch.spec.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react'
2-
import { createStore } from 'redux'
31
import { renderHook } from '@testing-library/react-hooks'
2+
import React from 'react'
3+
import type { ProviderProps, ReactReduxContextValue } from 'react-redux'
44
import {
5+
createDispatchHook,
56
Provider as ProviderMock,
67
useDispatch,
7-
createDispatchHook,
8-
} from '../../src/index'
9-
import type { ProviderProps, ReactReduxContextValue } from '../../src/'
8+
} from 'react-redux'
9+
import { createStore } from 'redux'
1010

1111
const store = createStore((c: number = 1): number => c + 1)
1212
const store2 = createStore((c: number = 1): number => c + 2)

test/hooks/useReduxContext.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { renderHook } from '@testing-library/react-hooks'
2-
import { createContext } from 'react'
3-
import type { ReactReduxContextValue } from '../../src/components/Context'
41
import {
52
createReduxContextHook,
63
useReduxContext,
7-
} from '../../src/hooks/useReduxContext'
4+
} from '@internal/hooks/useReduxContext'
5+
import { renderHook } from '@testing-library/react-hooks'
6+
import { createContext } from 'react'
7+
import type { ReactReduxContextValue } from 'react-redux'
88

99
describe('React', () => {
1010
describe('hooks', () => {

test/hooks/useSelector.spec.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*eslint-disable react/prop-types*/
22

3+
import type { UseSelectorOptions } from '@internal/hooks/useSelector'
34
import * as rtl from '@testing-library/react'
45
import type { DispatchWithoutAction, FunctionComponent, ReactNode } from 'react'
56
import React, {
@@ -11,15 +12,12 @@ import React, {
1112
useReducer,
1213
useState,
1314
} from 'react'
14-
import type { Action, AnyAction, Store } from 'redux'
15-
import { createStore } from 'redux'
16-
import type { UseSelectorOptions } from '../../src/hooks/useSelector'
1715
import type {
1816
ProviderProps,
1917
ReactReduxContextValue,
2018
Subscription,
2119
TypedUseSelectorHook,
22-
} from '../../src/index'
20+
} from 'react-redux'
2321
import {
2422
Provider,
2523
ReactReduxContext,
@@ -28,7 +26,9 @@ import {
2826
shallowEqual,
2927
useDispatch,
3028
useSelector,
31-
} from '../../src/index'
29+
} from 'react-redux'
30+
import type { Action, AnyAction, Store } from 'redux'
31+
import { createStore } from 'redux'
3232

3333
// disable checks by default
3434
function ProviderMock<A extends Action<any> = AnyAction, S = unknown>({

test/integration/dynamic-reducers.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import * as rtl from '@testing-library/react'
44
import type { ReactNode } from 'react'
55
import React from 'react'
66
import ReactDOMServer from 'react-dom/server'
7+
import type { ReactReduxContextValue } from 'react-redux'
8+
import { Provider, ReactReduxContext, connect } from 'react-redux'
79
import type { Store } from 'redux'
810
import { combineReducers, createStore } from 'redux'
9-
import type { ReactReduxContextValue } from '../../src/index'
10-
import { Provider, ReactReduxContext, connect } from '../../src/index'
1111

1212
describe('React', () => {
1313
/*

test/integration/server-rendering.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import type { PayloadAction } from '@reduxjs/toolkit'
1212
import type { FunctionComponent } from 'react'
1313
import React from 'react'
1414
import { renderToString } from 'react-dom/server'
15+
import { Provider, connect } from 'react-redux'
1516
import type { Dispatch, Store } from 'redux'
1617
import { createStore } from 'redux'
17-
import { Provider, connect } from '../../src/index'
1818

1919
describe('React', () => {
2020
describe('server rendering', () => {

test/integration/ssr.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import * as rtl from '@testing-library/react'
44
import React, { Suspense, useEffect, useState } from 'react'
55
import { hydrateRoot } from 'react-dom/client'
66
import { renderToString } from 'react-dom/server'
7-
import type { ConnectedProps } from '../../src/index'
8-
import { Provider, connect, useDispatch, useSelector } from '../../src/index'
7+
import type { ConnectedProps } from 'react-redux'
8+
import { Provider, connect, useDispatch, useSelector } from 'react-redux'
99

1010
const IS_REACT_18 = React.version.startsWith('18')
1111

0 commit comments

Comments
 (0)