Skip to content
This repository was archived by the owner on Jun 15, 2019. It is now read-only.

Commit c11e927

Browse files
committed
fix(puppeteer): The problem caused by global installed puppeteer was solved by reverting it to dev
1 parent 206bff8 commit c11e927

File tree

7 files changed

+370
-229
lines changed

7 files changed

+370
-229
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ jobs:
3939
name: "Build and Release"
4040
node_js: lts/*
4141

42-
if: env(BUILD_AND_RELEASE) && type == push && tag !~ ^v\d+\.\d+\.\d+ && branch == master &&
42+
if: env(BUILD_AND_RELEASE) == FORCE ||
43+
env(BUILD_AND_RELEASE) && type == push && tag !~ ^v\d+\.\d+\.\d+ && branch == master &&
4344
commit_message =~ /^((feat|fix|refactor|perf|build|revert)\(|test\((?i)[\s\S]*?\b(E2E|END-TO-END|END2END)\b)/ # https://regex101.com/r/XWKT5J/1/
4445

4546
script: >-
4647
if [[ $E2E_TEST == true || $SEMANTIC_RELEASE == true ]]; then
4748
npm run build:prod && (
4849
if [ $E2E_TEST == true ]; then
49-
npm i -g puppeteer && npm link puppeteer && npm run test:e2e;
50+
npm run test:e2e;
5051
else
5152
echo E2E-TEST IS DISABLED;
5253
fi

jest/e2e/browser.js.flow

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
const path = require('path')
88

9-
// noinspection NpmUsedModulesInstalled
10-
const Page = require('puppeteer') // Cannot find module 'puppeteer' => See the note in "./config/setup.js"
11-
// noinspection NpmUsedModulesInstalled
9+
const Page = require('puppeteer')
1210
const Browser = require('puppeteer')
1311

1412
const PORT = require('./config/options.js').listenPort

jest/e2e/config/puppeteer_environment.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const path = require('path')
99
const os = require('os')
1010

1111
const NodeEnvironment = require('jest-environment-node')
12-
// noinspection NpmUsedModulesInstalled
13-
const puppeteer = require('puppeteer') // Cannot find module 'puppeteer' => See the note in "./setup.js"
12+
const puppeteer = require('puppeteer')
1413

1514
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup')
1615

jest/e2e/config/setup.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ const path = require('path')
99
const url = require('url')
1010
const http = require('http')
1111

12-
// Before run `test:e2e` you need to run `npm i -g puppeteer && npm link puppeteer` (as a one-time-action).
13-
// Why it's not in devDependencies?
14-
// Regularly we install such packages locally (--save or --save-dev) but exceptionally I suggest installing `puppeteer`
15-
// globally, because of its extra installation step (node install.js ---> Downloading Chromium r662092 - 140.3 Mb) and
16-
// because it just required for end-to-end tests.
17-
18-
// noinspection NpmUsedModulesInstalled
19-
const puppeteer = require('puppeteer') // Error: Cannot find module 'puppeteer' => See above note
12+
const puppeteer = require('puppeteer')
2013

2114
const mkdirp = require('mkdirp')
2215

0 commit comments

Comments
 (0)