Skip to content

Commit a86fd96

Browse files
committed
refactor: remove index from import paths in tests
1 parent 62f05ba commit a86fd96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+42
-42
lines changed

src/dom/__tests__/asyncHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useRef, useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('async hook tests', () => {
55
const useSequence = (...values: string[]) => {

src/dom/__tests__/autoCleanup.disabled.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('skip auto cleanup (disabled) tests', () => {
1111
beforeAll(() => {
1212
process.env.RHTL_SKIP_AUTO_CLEANUP = 'true'
1313
// eslint-disable-next-line @typescript-eslint/no-var-requires
14-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
14+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1515
})
1616

1717
test('first', () => {

src/dom/__tests__/autoCleanup.noAfterEach.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('skip auto cleanup (no afterEach) tests', () => {
1313
// eslint-disable-next-line no-global-assign
1414
afterEach = false
1515
// eslint-disable-next-line @typescript-eslint/no-var-requires
16-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
16+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1717
})
1818

1919
test('first', () => {

src/dom/__tests__/autoCleanup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
// This verifies that by importing RHTL in an
55
// environment which supports afterEach (like Jest)

src/dom/__tests__/customHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('custom hook tests', () => {
55
function useCounter() {

src/dom/__tests__/errorHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('error hook tests', () => {
55
function useError(throwError?: boolean) {

src/dom/__tests__/resultHistory.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '../index'
1+
import { renderHook } from '..'
22

33
describe('result history tests', () => {
44
let count = 0

src/dom/__tests__/suspenseHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '../index'
1+
import { renderHook } from '..'
22

33
describe('suspense hook tests', () => {
44
const cache: { value?: Promise<string | Error> | string | Error } = {}

src/dom/__tests__/useContext.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { createContext, useContext } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useContext tests', () => {
55
test('should get default value from context', () => {

src/dom/__tests__/useEffect.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useLayoutEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useEffect tests', () => {
55
test('should handle useEffect hook', () => {

src/dom/__tests__/useMemo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useCallback } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useCallback tests', () => {
55
test('should handle useMemo hook', () => {

src/dom/__tests__/useReducer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useReducer } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useReducer tests', () => {
55
test('should handle useReducer hook', () => {

src/dom/__tests__/useRef.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useImperativeHandle } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useHook tests', () => {
55
test('should handle useRef hook', () => {

src/dom/__tests__/useState.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useState tests', () => {
55
test('should use setState value', () => {

src/native/__tests__/asyncHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useRef, useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('async hook tests', () => {
55
const useSequence = (...values: string[]) => {

src/native/__tests__/autoCleanup.disabled.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('skip auto cleanup (disabled) tests', () => {
1111
beforeAll(() => {
1212
process.env.RHTL_SKIP_AUTO_CLEANUP = 'true'
1313
// eslint-disable-next-line @typescript-eslint/no-var-requires
14-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
14+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1515
})
1616

1717
test('first', () => {

src/native/__tests__/autoCleanup.noAfterEach.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('skip auto cleanup (no afterEach) tests', () => {
1313
// eslint-disable-next-line no-global-assign
1414
afterEach = false
1515
// eslint-disable-next-line @typescript-eslint/no-var-requires
16-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
16+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1717
})
1818

1919
test('first', () => {

src/native/__tests__/autoCleanup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
// This verifies that by importing RHTL in an
55
// environment which supports afterEach (like Jest)

src/native/__tests__/customHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('custom hook tests', () => {
55
function useCounter() {

src/native/__tests__/errorHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('error hook tests', () => {
55
function useError(throwError?: boolean) {

src/native/__tests__/resultHistory.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '../index'
1+
import { renderHook } from '..'
22

33
describe('result history tests', () => {
44
let count = 0

src/native/__tests__/suspenseHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '../index'
1+
import { renderHook } from '..'
22

33
describe('suspense hook tests', () => {
44
const cache: { value?: Promise<string | Error> | string | Error } = {}

src/native/__tests__/useContext.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { createContext, useContext } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useContext tests', () => {
55
test('should get default value from context', () => {

src/native/__tests__/useEffect.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useLayoutEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useEffect tests', () => {
55
test('should handle useEffect hook', () => {

src/native/__tests__/useMemo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useCallback } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useCallback tests', () => {
55
test('should handle useMemo hook', () => {

src/native/__tests__/useReducer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useReducer } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useReducer tests', () => {
55
test('should handle useReducer hook', () => {

src/native/__tests__/useRef.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useImperativeHandle } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useHook tests', () => {
55
test('should handle useRef hook', () => {

src/native/__tests__/useState.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useState tests', () => {
55
test('should use setState value', () => {

src/server/__tests__/asyncHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useRef, useEffect } from 'react'
22

3-
import { renderHook } from '../index'
3+
import { renderHook } from '..'
44

55
describe('async hook tests', () => {
66
const useSequence = (...values: string[]) => {

src/server/__tests__/autoCleanup.disabled.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('skip auto cleanup (disabled) tests', () => {
1111
beforeAll(() => {
1212
process.env.RHTL_SKIP_AUTO_CLEANUP = 'true'
1313
// eslint-disable-next-line @typescript-eslint/no-var-requires
14-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
14+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1515
})
1616

1717
test('first', () => {

src/server/__tests__/autoCleanup.noAfterEach.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('skip auto cleanup (no afterEach) tests', () => {
1313
// eslint-disable-next-line no-global-assign
1414
afterEach = false
1515
// eslint-disable-next-line @typescript-eslint/no-var-requires
16-
renderHook = (require('../index') as ReactHooksRenderer).renderHook
16+
renderHook = (require('..') as ReactHooksRenderer).renderHook
1717
})
1818

1919
test('first', () => {

src/server/__tests__/autoCleanup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
// This verifies that by importing RHTL in an
55
// environment which supports afterEach (like Jest)

src/server/__tests__/cleanup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react'
2-
import { renderHook, cleanup } from '../index'
2+
import { renderHook, cleanup } from '..'
33

44
describe('cleanup tests', () => {
55
test('should flush effects on cleanup', async () => {

src/server/__tests__/customHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('custom hook tests', () => {
55
function useCounter() {

src/server/__tests__/errorHook.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect } from 'react'
22

3-
import { renderHook } from '../index'
3+
import { renderHook } from '..'
44

55
describe('error hook tests', () => {
66
function useError(throwError?: boolean) {

src/server/__tests__/hydrationErrors.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useCallback } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('hydration errors tests', () => {
55
function useCounter() {

src/server/__tests__/useContext.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { createContext, useContext } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useContext tests', () => {
55
test('should get default value from context', () => {

src/server/__tests__/useEffect.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useEffect tests', () => {
55
test('should handle useEffect hook', () => {

src/server/__tests__/useMemo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useCallback } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useCallback tests', () => {
55
test('should handle useMemo hook', () => {

src/server/__tests__/useReducer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useReducer } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useReducer tests', () => {
55
test('should handle useReducer hook', () => {

src/server/__tests__/useRef.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useImperativeHandle } from 'react'
2-
import { renderHook } from '../index'
2+
import { renderHook } from '..'
33

44
describe('useHook tests', () => {
55
test('should handle useRef hook', () => {

src/server/__tests__/useState.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import { renderHook, act } from '../index'
2+
import { renderHook, act } from '..'
33

44
describe('useState tests', () => {
55
test('should use state value', () => {

0 commit comments

Comments
 (0)