Socket
Socket
Sign inDemoInstall

mocha-headless-chrome

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-headless-chrome - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

16

CHANGELOG.md

@@ -10,6 +10,20 @@ # Changelog

## 3.0.0 - 2020-05-01
### Added
- issue [#39](https://github.com/direct-adv-interfaces/mocha-headless-chrome/issues/39): Added `polling` parameter that can specify puppeteer polling mechanism.
### Changed
- Update [puppeteer](https://www.npmjs.com/package/puppeteer) package.
- issue [#44](https://github.com/direct-adv-interfaces/mocha-headless-chrome/issues/44): Empty messages are ignored when output to the console.
### Fixed
- PR [#50](https://github.com/direct-adv-interfaces/mocha-headless-chrome/pull/50): Fix the error when console output arguments is not serializable.
### BREAKING CHANGES
- Update [puppeteer](https://www.npmjs.com/package/puppeteer) package to 3.0.2 version. It means that Node versions before 10.18.1 are not supported.
## 2.0.1 - 2018-06-29

@@ -16,0 +30,0 @@

@@ -18,2 +18,3 @@ 'use strict';

.option('visible', 'Show Chrome window', undefined, Boolean)
.option('polling', 'Puppeteer polling mechanism', undefined, String)
.example('mocha-headless-chrome -f test.html', 'Run tests on the "test.html" page')

@@ -20,0 +21,0 @@ .example('mocha-headless-chrome -f http://localhost:8080', 'Run tests on the remote page')

@@ -44,2 +44,7 @@ /**

visible?: boolean;
/**
* Puppeteer polling mechanism.
*/
polling?: string;
}

@@ -46,0 +51,0 @@

11

lib/runner.js

@@ -131,3 +131,3 @@ 'use strict';

Promise.all(args.map(a => a.jsonValue()))
Promise.all(args.map(a => a.jsonValue().catch(() => '')))
.then(args => {

@@ -137,5 +137,5 @@ // process stdout stub

isStdout && (args = args.slice(1));
//
let msg = util.format(...args);
!isStdout && (msg += '\n');
!isStdout && msg && (msg += '\n');
process.stdout.write(msg);

@@ -156,3 +156,3 @@ });

exports.runner = function ({ file, reporter, timeout, width, height, args, executablePath, visible }) {
exports.runner = function ({ file, reporter, timeout, width, height, args, executablePath, visible, polling }) {
return new Promise(resolve => {

@@ -167,2 +167,3 @@

!timeout && (timeout = 60000);
/^\d+$/.test(polling) && (polling = parseInt(polling));

@@ -190,3 +191,3 @@ const url = prepareUrl(file);

.then(() => page.goto(url))
.then(() => page.waitForFunction(() => window.__mochaResult__, { timeout: timeout }))
.then(() => page.waitForFunction(() => window.__mochaResult__, { timeout, polling }))
.then(() => page.evaluate(() => window.__mochaResult__))

@@ -193,0 +194,0 @@ .then(obj => {

{
"name": "mocha-headless-chrome",
"version": "2.0.3",
"version": "3.0.0",
"description": "Run client-side mocha tests in the command line through headless Chrome",

@@ -9,7 +9,8 @@ "main": "./lib/runner.js",

"engines": {
"node": ">=6.4.0"
"node": ">=10.18.1"
},
"scripts": {
"test": "node lib/cli -f ./example/example-page.html -o ./result/result.json -c ./result/coverage.json -w 801 -H 501 -a incognito",
"ts": "tsc ./example/example.ts && node ./example/example.js"
"ts": "tsc ./example/example.ts && node ./example/example.js",
"help": "node lib/cli -h"
},

@@ -34,11 +35,11 @@ "repository": {

"dependencies": {
"args": "^5.0.0",
"mkdirp": "^0.5.1",
"puppeteer": "^1.17.0"
"args": "^5.0.1",
"mkdirp": "^1.0.4",
"puppeteer": "^3.0.2"
},
"devDependencies": {
"chai": "^4.1.2",
"mocha": "^5.0.0",
"mocha-teamcity-reporter": "^2.4.0"
"chai": "^4.2.0",
"mocha": "^7.1.2",
"mocha-teamcity-reporter": "^3.0.0"
}
}

@@ -10,3 +10,3 @@ # mocha-headless-chrome

Node 6.4.0+ and Mocha 2.3.0+ are supported.
Node 10.18.1+ and Mocha 2.3.0+ are supported.

@@ -17,3 +17,3 @@ ## Getting Started

```
```sh
npm i mocha-headless-chrome

@@ -28,3 +28,3 @@ ```

```
```sh
mocha-headless-chrome -f test-page.html

@@ -45,2 +45,3 @@ ```

- **-t, --timeout** - Timeout in ms (defaults to 60000)
- **-p, --polling** - Puppeteer polling mechanism
- **-h, --help** - Output usage information

@@ -52,23 +53,23 @@

```sh
mocha-headless-chrome -f test.html
```
$ mocha-headless-chrome -f test.html
```
Run tests on the remote page:
```sh
mocha-headless-chrome -f http://localhost:8080
```
$ mocha-headless-chrome -f http://localhost:8080
```
Output test results using "nyan" reporter:
```sh
mocha-headless-chrome -f test.html -r nyan
```
$ mocha-headless-chrome -f test.html -r nyan
```
Pass the Chrome **--no-sandbox** and **--disable-setuid-sandbox** arguments:
```sh
mocha-headless-chrome -f test.html -a no-sandbox -a disable-setuid-sandbox
```
$ mocha-headless-chrome -f test.html -a no-sandbox -a disable-setuid-sandbox
```

@@ -83,3 +84,2 @@ ## Mocha reporters

## Programmatically usage

@@ -111,2 +111,1 @@

See also the [TypeScript example](./example/example.ts).
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