ts-jest-puppeteer

0.0.5 • Public • Published

ts-jest-puppeteer

Installation

yarn add -D ts-jest-puppeteer

Usage

// jest.config.js
 
module.exports = {
  preset: 'ts-jest-puppeteer'
}

Launch Options

You can custom your puppeteer launch option thro PUPPETEER_LAUNCH_CONFIG env. The default value is puppeteer-launch.js

// puppeteer-launch.js
 
module.export = {
  // launch options
}
$ PUPPETEER_LAUNCH_CONFIG=puppeteer-launch.js jest

Example

// google.spec.ts
 
describe('Google', () => {
  beforeAll(async () => {
    await page.goto('https://google.com')
  })
 
  it('should display "google" text on page', async () => {
    await expect(page).toMatch('google')
  })
})

Package Sidebar

Install

npm i ts-jest-puppeteer

Weekly Downloads

225

Version

0.0.5

License

MIT

Unpacked Size

3.54 kB

Total Files

7

Last publish

Collaborators

  • rwu823