UNPKG

jest-puppe-shots

Version:

A Jest plugin for creating screenshots of React components with a help of Puppeteer

10 lines (7 loc) 211 B
async function createElementScreenshot(page, selector = 'body > [data-reactroot]') { const element = await page.$(selector); return element.screenshot(); } module.exports = { createElementScreenshot, };