garris / garris/BackstopJS

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Open
#556 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

## Steps to reproduce
* Run `backstop init`.
* Modify configuration file to the same as below.
* Run `backstop test`
* Then the following error is printed to console:
```
BackstopJS v3.0.26
Loading config: backstop.json

COMMAND | Executing core for `test`
createBitmaps | Selected 1 of 1 scenarios.
Starting Chromy: port:9222 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=320,480
Cookie state restored with: []
SCENARIO > Styleguide
Starting Chromy: port:9223 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=1024,768
Cookie state restored with: []
SCENARIO > Styleguide
COMMAND | Command `test` ended with an error after [3.7s]
COMMAND | BackstopException: Styleguide on undefined: Error: An error has occurred evaluating the script in the browser.SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at Object.InjectedScript._evaluateOn (:875:140)
at Object.InjectedScript._evaluateAndWrap (:808:34)
at Object.InjectedScript.evaluate (:664:21)
```

## Environment
* npm version: 5.3.0
* node version: 8.2.1
* OS: Windows 10

## Config

```json
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "chromy/onBefore.js",
"onReadyScript": "chromy/onReady.js",
"scenarios": [
{
"label": "Styleguide",
"url": "http://localhost:6060/",
"readyEvent": "",
"readySelector": "",
"delay": 0,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": "",
"selectors": [
"[class^=\"rsg--preview-\"]"
],
"selectorExpansion": true,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "chrome",
"engineFlags": [],
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": true,
"debugWindow": true
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.