lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
3 deletions
-
tests/shared/imageTest.tsx
|
|
@ -35,11 +35,14 @@ export default function imageTest(component: React.ReactElement) { |
|
|
|
await page.addStyleTag({ path: `${process.cwd()}/dist/reset.css` }); |
|
|
|
|
|
|
|
const cache = createCache(); |
|
|
|
const html = ReactDOMServer.renderToString( |
|
|
|
|
|
|
|
const element = ( |
|
|
|
<App> |
|
|
|
<StyleProvider cache={cache}>{component}</StyleProvider>, |
|
|
|
</App>, |
|
|
|
<StyleProvider cache={cache}>{component}</StyleProvider> |
|
|
|
</App> |
|
|
|
); |
|
|
|
|
|
|
|
const html = ReactDOMServer.renderToString(element); |
|
|
|
const styleStr = extractStyle(cache); |
|
|
|
|
|
|
|
await page.evaluate( |
|
|
|