Skip to content

Commit 929f6f3

Browse files
committed
Compbined React import lines in tests
1 parent 63ee2f9 commit 929f6f3

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

test/customHook.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react'
2-
import { useState, createContext, useContext, useMemo } from 'react'
1+
import React, { useState, createContext, useContext, useMemo } from 'react'
32
import { renderHook, cleanup, act } from 'src'
43

54
describe('custom hook tests', () => {

test/useContext.test.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react'
2-
import { createContext, useContext } from 'react'
1+
import React, { createContext, useContext } from 'react'
32
import { renderHook, cleanup } from 'src'
43

54
describe('useContext tests', () => {
@@ -15,30 +14,6 @@ describe('useContext tests', () => {
1514
expect(value).toBe('foo')
1615
})
1716

18-
test('should get default value from context provider', () => {
19-
const TestContext = createContext('foo')
20-
21-
const { result } = renderHook(() => useContext(TestContext))
22-
23-
const value = result.current
24-
25-
expect(value).toBe('foo')
26-
})
27-
28-
test('should get value from context', () => {
29-
const TestContext = createContext('foo')
30-
31-
const wrapper = ({ children }) => (
32-
<TestContext.Provider value="bar">{children}</TestContext.Provider>
33-
)
34-
35-
const { result } = renderHook(() => useContext(TestContext), { wrapper })
36-
37-
const value = result.current
38-
39-
expect(value).toBe('bar')
40-
})
41-
4217
test('should get value from context provider', () => {
4318
const TestContext = createContext('foo')
4419

0 commit comments

Comments
 (0)