Skip to content

Commit 9e3912b

Browse files
committed
tweaks
1 parent 6511abc commit 9e3912b

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

packages/jest/test/matchers.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'test-utils/setup-env'
33
import React from 'react'
44
import { act } from 'react'
55
import { render } from '@testing-library/react'
6-
import * as testRenderer from 'react-test-renderer'
6+
import testRenderer from 'react-test-renderer'
77
import { css, jsx } from '@emotion/react'
88
import styled from '@emotion/styled'
99
import { matchers } from '@emotion/jest'

packages/jest/test/printer.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { css, jsx, CacheProvider } from '@emotion/react'
77
import createCache from '@emotion/cache'
88
import { createSerializer } from '@emotion/jest'
99
import { render } from '@testing-library/react'
10-
import * as testRenderer from 'react-test-renderer'
10+
import testRenderer from 'react-test-renderer'
1111
import { ignoreConsoleErrors } from 'test-utils'
1212

1313
let emotionPlugin = createSerializer()

packages/native/test/native-styled.test.js

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { act } from 'react'
3-
import renderer from 'react-test-renderer'
3+
import testRenderer from 'react-test-renderer'
44
import { ThemeProvider } from '@emotion/react'
55
import styled, { css } from '@emotion/native'
66
import reactNative from 'react-native'
@@ -30,7 +30,7 @@ describe('Emotion native styled', () => {
3030
`
3131
const tree = (
3232
await act(() =>
33-
renderer.create(
33+
testRenderer.create(
3434
<Text style={{ fontSize: 40 }} back="red">
3535
Emotion Primitives
3636
</Text>
@@ -47,7 +47,7 @@ describe('Emotion native styled', () => {
4747

4848
const tree = (
4949
await act(() =>
50-
renderer.create(
50+
testRenderer.create(
5151
<ThemeProvider theme={theme}>
5252
<Text>Hello World</Text>
5353
</ThemeProvider>
@@ -64,7 +64,7 @@ describe('Emotion native styled', () => {
6464
}))
6565
const tree = (
6666
await act(() =>
67-
renderer.create(<Text decor="hotpink">Emotion Primitives</Text>)
67+
testRenderer.create(<Text decor="hotpink">Emotion Primitives</Text>)
6868
)
6969
).toJSON()
7070
expect(tree).toMatchSnapshot()
@@ -76,7 +76,7 @@ describe('Emotion native styled', () => {
7676
`
7777
const tree = (
7878
await act(() =>
79-
renderer.create(
79+
testRenderer.create(
8080
<Title style={{ padding: 10 }}>Emotion primitives</Title>
8181
)
8282
)
@@ -91,7 +91,7 @@ describe('Emotion native styled', () => {
9191
`
9292
const tree = (
9393
await act(() =>
94-
renderer.create(<Text style={styles.foo}>Emotion primitives</Text>)
94+
testRenderer.create(<Text style={styles.foo}>Emotion primitives</Text>)
9595
)
9696
).toJSON()
9797
expect(tree).toMatchSnapshot()
@@ -103,7 +103,7 @@ describe('Emotion native styled', () => {
103103
`
104104
const Name = Text.withComponent(reactNative.Text)
105105
const tree = (
106-
await act(() => renderer.create(<Name decor="hotpink">Mike</Name>))
106+
await act(() => testRenderer.create(<Name decor="hotpink">Mike</Name>))
107107
).toJSON()
108108
expect(tree).toMatchSnapshot()
109109
})
@@ -118,7 +118,7 @@ describe('Emotion native styled', () => {
118118
font-style: ${props => props.sty};
119119
`
120120
const tree = (
121-
await act(() => renderer.create(<StyledTitle sty="italic" />))
121+
await act(() => testRenderer.create(<StyledTitle sty="italic" />))
122122
).toJSON()
123123
expect(tree).toMatchSnapshot()
124124
})
@@ -127,10 +127,12 @@ describe('Emotion native styled', () => {
127127
const ViewOne = styled.View`
128128
background-color: ${props => props.color};
129129
`
130-
const treeOne = await act(() => renderer.create(<ViewOne color="green" />))
130+
const treeOne = await act(() =>
131+
testRenderer.create(<ViewOne color="green" />)
132+
)
131133
const ViewTwo = ViewOne.withComponent(reactNative.Text)
132134
const treeTwo = await act(() =>
133-
renderer.create(<ViewTwo color="hotpink" />)
135+
testRenderer.create(<ViewTwo color="hotpink" />)
134136
)
135137

136138
expect(treeOne).toMatchSnapshot()
@@ -143,7 +145,7 @@ describe('Emotion native styled', () => {
143145
`
144146
const tree = (
145147
await act(() =>
146-
renderer.create(
148+
testRenderer.create(
147149
<Image
148150
source={{
149151
uri: 'https://camo.githubusercontent.com/209bdea972b9b6ef90220c59ecbe66d35ffefa8a/68747470733a2f2f63646e2e7261776769742e636f6d2f746b6834342f656d6f74696f6e2f6d61737465722f656d6f74696f6e2e706e67',
@@ -164,7 +166,7 @@ describe('Emotion native styled', () => {
164166
padding: 20;
165167
`
166168

167-
await act(() => renderer.create(<Text>Hello World</Text>))
169+
await act(() => testRenderer.create(<Text>Hello World</Text>))
168170

169171
expect(console.error).toBeCalledWith(
170172
"'padding' shorthand property requires units for example - padding: 20px or padding: 10px 20px 40px 50px"
@@ -183,7 +185,7 @@ describe('Emotion native styled', () => {
183185

184186
const tree = (
185187
await act(() =>
186-
renderer.create(<Text backgroundColor="blue">Hello World</Text>)
188+
testRenderer.create(<Text backgroundColor="blue">Hello World</Text>)
187189
)
188190
).toJSON()
189191

0 commit comments

Comments
 (0)