Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-environment-puppeteer

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-environment-puppeteer - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/readConfig.js

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="0.2.0"></a>
# [0.2.0](https://github.com/smooth-code/jest-environment-puppeteer/compare/v0.1.0...v0.2.0) (2018-03-03)
### Features
* support Puppeteer configuration ([31972ae](https://github.com/smooth-code/jest-environment-puppeteer/commit/31972ae))
<a name="0.1.0"></a>

@@ -7,0 +17,0 @@ # 0.1.0 (2018-03-02)

10

lib/global.js

@@ -23,2 +23,6 @@ 'use strict';

var _readConfig = require('./readConfig');
var _readConfig2 = _interopRequireDefault(_readConfig);
var _constants = require('./constants');

@@ -31,6 +35,4 @@

async function setup() {
browser = await _puppeteer2.default.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
headless: process.env.HEADLESS !== 'false'
});
const config = await (0, _readConfig2.default)();
browser = await _puppeteer2.default.launch(config);
_mkdirp2.default.sync(_constants.DIR);

@@ -37,0 +39,0 @@ _fs2.default.writeFileSync(_constants.WS_ENDPOINT_PATH, browser.wsEndpoint());

4

package.json
{
"name": "jest-environment-puppeteer",
"description": "Run your tests using Jest & Puppeteer.",
"version": "0.1.0",
"version": "0.2.0",
"main": "index.js",

@@ -20,2 +20,3 @@ "repository": "git@github.com:smooth-code/jest-environment-puppeteer.git",

"ci": "yarn build && yarn lint && yarn test",
"dev": "babel src -d lib --watch",
"format": "prettier --write \"src/**/*.js\" \"*.md\" \"*.js\"",

@@ -46,2 +47,3 @@ "lint": "eslint .",

"dependencies": {
"cwd": "^0.10.0",
"mkdirp": "^0.5.1",

@@ -48,0 +50,0 @@ "rimraf": "^2.6.2"

@@ -42,6 +42,20 @@ # jest-environment-puppeteer

### Writing test using Puppeteer
### Writing tests using Puppeteer
Writing test using Puppeteer is simple, you can find all available methods in [Puppeteer documentation](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md).
To write your integration tests using Puppeteer you can find all available methods in [Puppeteer documentation](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md).
### Configure Puppeteer
Jest Puppeteer automatically detect the best config to start Puppeteer but sometimes you may need to specify custom options.
[All Puppeteer launch options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions) can be specified in `jest-puppeteer.config.js` at the root of the project. Since it is JavaScript, you can use all stuff you need, including environment.
```js
// jest-puppeteer.config.js
module.exports = {
dumpio: true,
headless: process.env.HEADLESS !== 'false',
}
```
### Extend PuppeteerEnvironment

@@ -48,0 +62,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc