0.2.0 • Published 3 years ago

foreal v0.2.0

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

foreal npm

Test React app with Puppeteer.

Install

$ yarn add foreal

Usage

type TGetAppPageOptions = {
  entryPointPath: string,
  fontsDir?: string,
  width?: number,
  height?: number,
  deviceScaleFactor?: number,
}

const getAppPage: (options: TGetAppPageOptions) => Promise<Page>
// App.tsx
export const App = () => (
  <h1>hi</h1>
)
import { getAppPage } from 'foreal'

const page = await getAppPage({
  entryPointPath: './App.tsx'
})

const result = await page.$eval('h1', (el) => el.textContent)

console.log(result)
// 'hi'

// necessary to call when it's done
await page.close()
0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago

0.0.0

4 years ago