Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rwu823/ts-jest-puppeteer

:repeat: Run your tests using Jest & Puppeteer with TypeScript.
https://github.com/rwu823/ts-jest-puppeteer

jest puppeteer typescript

Last synced: about 1 month ago
JSON representation

:repeat: Run your tests using Jest & Puppeteer with TypeScript.

Awesome Lists containing this project

README

        


ts-jest-puppeteer








## Installation

~~~sh
yarn add -D ts-jest-puppeteer
~~~

## Usage

~~~js
// jest.config.js

module.exports = {
preset: 'ts-jest-puppeteer'
}
~~~

## Launch Options
You can custom your puppeteer [launch option](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-puppeteerlaunchoptions) thro `PUPPETEER_LAUNCH_CONFIG` env. The default value is `puppeteer-launch.js`

~~~js
// puppeteer-launch.js

module.export = {
// launch options
}
~~~

~~~sh
$ PUPPETEER_LAUNCH_CONFIG=puppeteer-launch.js jest
~~~

## Example

~~~js
// 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')
})
})
~~~