jest-environment-puppeteer
Advanced tools
Comparing version 8.0.5 to 8.0.6
@@ -57,9 +57,2 @@ import NodeEnvironment from 'jest-environment-node'; | ||
type JestPuppeteerGlobal = Required<StrictGlobal>; | ||
declare global { | ||
var browser: Global["browser"]; | ||
var page: Global["page"]; | ||
var context: Global["context"]; | ||
var puppeteerConfig: Global["puppeteerConfig"]; | ||
var jestPuppeteer: Global["jestPuppeteer"]; | ||
} | ||
declare class PuppeteerEnvironment extends NodeEnvironment { | ||
@@ -71,2 +64,2 @@ setTimeout(timeout: number): void; | ||
export { JestPuppeteerConfig, JestPuppeteerGlobal, PuppeteerEnvironment as default }; | ||
export { JestPuppeteerConfig, JestPuppeteerGlobal, PuppeteerEnvironment as TestEnvironment, PuppeteerEnvironment as default }; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var NodeEnvironment = require('jest-environment-node'); | ||
@@ -260,2 +262,3 @@ var cosmiconfig = require('cosmiconfig'); | ||
module.exports = PuppeteerEnvironment; | ||
exports.TestEnvironment = PuppeteerEnvironment; | ||
exports.default = PuppeteerEnvironment; |
{ | ||
"name": "jest-environment-puppeteer", | ||
"description": "Puppeteer environment for Jest.", | ||
"version": "8.0.5", | ||
"version": "8.0.6", | ||
"type": "commonjs", | ||
@@ -58,3 +58,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "05992b2c3082b68bac0fffb8e4f1847a7ae4472d" | ||
"gitHead": "f756dc3ee3dae34a0a5c1855598f54c45fea9441" | ||
} |
@@ -203,4 +203,18 @@ # jest-environment-puppeteer | ||
## Create custom environment | ||
It is possible to create a custom environment from the Jest Puppeteer's one. It is not different from creating a custom environment from "jest-environment-node". See [Jest `testEnvironment` documentation](https://jestjs.io/docs/configuration#testenvironment-string) to learn more about it. | ||
```js | ||
// my-custom-environment | ||
const JestPuppeteerEnvironment = | ||
require("jest-environment-puppeteer").TestEnvironment; | ||
class CustomEnvironment extends JestPuppeteerEnvironment { | ||
// Implement your own environment | ||
} | ||
``` | ||
## Inspiration | ||
Thanks to Fumihiro Xue for his great [Jest example](https://github.com/xfumihiro/jest-puppeteer-example). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24224
220
469