ts-jest-puppeteer
v0.0.5
Published
Run your tests using Jest & Puppeteer with TypeScript.
Downloads
339
Readme
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')
})
})