Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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', () => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /