jest-environment-puppeteer
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -6,2 +6,18 @@ # Change Log | ||
# [3.8.0](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/compare/v3.7.0...v3.8.0) (2019-01-11) | ||
### Bug Fixes | ||
* disconnect the browser on environment teardown ([#173](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/issues/173)) ([5d073cc](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/commit/5d073cc)) | ||
### Features | ||
* **jest-environment-puppeteer:** accept a promise as config ([#178](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/issues/178)) ([40bc3a2](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/commit/40bc3a2)) | ||
# [3.7.0](https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer/compare/v3.6.0...v3.7.0) (2018-12-11) | ||
@@ -8,0 +24,0 @@ |
@@ -126,2 +126,4 @@ "use strict"; | ||
} | ||
await this.global.browser.disconnect(); | ||
} | ||
@@ -128,0 +130,0 @@ |
@@ -48,4 +48,3 @@ "use strict"; | ||
const localConfig = require(absConfigPath); | ||
const localConfig = await require(absConfigPath); | ||
return (0, _mergeDeep.default)({}, defaultConfig, localConfig); | ||
@@ -52,0 +51,0 @@ } |
{ | ||
"name": "jest-environment-puppeteer", | ||
"description": "Puppeteer environment for Jest.", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"main": "index.js", | ||
@@ -32,3 +32,3 @@ "repository": "https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer", | ||
}, | ||
"gitHead": "8b7df93ed52fd2edabaa7af702aaa4742e13c81b" | ||
"gitHead": "d2355a17ca878928b17fd9a63fb547261d9fbeef" | ||
} |
@@ -82,3 +82,3 @@ # jest-environment-puppeteer | ||
You can specify a `jest-puppeteer.config.js` at the root of the project or define a custom path using `JEST_PUPPETEER_CONFIG` environment variable. | ||
You can specify a `jest-puppeteer.config.js` at the root of the project or define a custom path using `JEST_PUPPETEER_CONFIG` environment variable. It should export a config object or a Promise for a config object. | ||
@@ -117,15 +117,22 @@ - `launch` <[object]> [All Puppeteer launch options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions) can be specified in config. Since it is JavaScript, you can use all stuff you need, including environment. | ||
// jest-puppeteer.config.js | ||
const wsEndpoint = fs.readFileSync(endpointPath, 'utf8') | ||
const fetch = require('node-fetch') | ||
const dockerHost = 'http://localhost:9222' | ||
module.exports = { | ||
connect: { | ||
browserWSEndpoint: wsEndpoint, | ||
}, | ||
server: { | ||
command: 'node server.js', | ||
port: 4444, | ||
launchTimeout: 10000, | ||
debug: true, | ||
}, | ||
async function getConfig () { | ||
const response = await fetch(`${dockerHost}/json/version`) | ||
const browserWSEndpoint = (await response.json()).webSocketDebuggerUrl | ||
return { | ||
connect: { | ||
browserWSEndpoint | ||
}, | ||
server: { | ||
command: 'node server.js', | ||
port: 3000, | ||
launchTimeout: 10000, | ||
debug: true, | ||
} | ||
} | ||
} | ||
module.exports = getConfig() | ||
``` | ||
@@ -132,0 +139,0 @@ |
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
25600
190
152