Skip to content

Commit

Permalink
Enable e2e test on ci (bvaughn#928)
Browse files Browse the repository at this point in the history
Enable e2e test on ci
  • Loading branch information
TrySound authored Jan 19, 2018
1 parent a1f8b88 commit b91c31b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
command: yarn ci-check
test:
docker:
- image: circleci/node:latest
- image: circleci/node:8.9.1-stretch-browsers
steps:
- checkout
- restore_cache:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"start": "webpack-dev-server --hot --config webpack.config.dev.js",
"test": "npm run test:jest",
"test:jest": "jest --no-watchman --runInBand",
"test:ci": "cross-env JEST=ci jest --testPathPattern=\".(jest|ssr).js\" --no-watchman --maxWorkers 2 --coverage && codecov",
"test:ci": "jest --no-watchman --maxWorkers 2 --coverage && codecov",
"watch": "watch 'clear && npm run test -s' source",
"watch:jest": "jest --no-watchman --watch"
},
Expand Down Expand Up @@ -138,7 +138,7 @@
"postcss-cli": "^4.1.1",
"postcss-loader": "^2.0.9",
"prettier": "^1.9.2",
"puppeteer": "^0.13.0",
"puppeteer": "^1.0.0",
"react": "^16.0.0",
"react-codemirror": "^1.0.0",
"react-dom": "^16.0.0",
Expand Down
14 changes: 7 additions & 7 deletions source/jest-global-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const writeFile = util.promisify(fs.writeFile);
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');

module.exports = async function() {
if (process.env.JEST !== 'ci') {
console.log('Setup Puppeteer Environment.');
const browser = await puppeteer.launch({});
global.__BROWSER__ = browser;
await makeDir(DIR);
await writeFile(path.join(DIR, 'wsEndpoint'), browser.wsEndpoint());
}
console.log('Setup Puppeteer Environment.');
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
global.__BROWSER__ = browser;
await makeDir(DIR);
await writeFile(path.join(DIR, 'wsEndpoint'), browser.wsEndpoint());
};
8 changes: 3 additions & 5 deletions source/jest-global-teardown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const del = util.promisify(rimraf);
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');

module.exports = async function() {
if (process.env.JEST !== 'ci') {
console.log('Teardown Puppeteer Environment.');
await global.__BROWSER__.close();
await del(DIR);
}
console.log('Teardown Puppeteer Environment.');
await global.__BROWSER__.close();
await del(DIR);
};
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6061,9 +6061,9 @@ punycode@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"

puppeteer@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-0.13.0.tgz#2e6956205f2c640964c2107f620ae1eef8bde8fd"
puppeteer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.0.0.tgz#20f3bb6ad6c6778b4d1fb750e808a29fec0a88a4"
dependencies:
debug "^2.6.8"
extract-zip "^1.6.5"
Expand Down

0 comments on commit b91c31b

Please sign in to comment.