0.0.5 • Published 4 years ago

ts-jest-puppeteer v0.0.5

Weekly downloads
95
License
MIT
Repository
github
Last release
4 years ago

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')
  })
})