Skip to content

Commit

Permalink
Fix browser test in CI (#10)
Browse files Browse the repository at this point in the history
* replace phantomjs with headless_chrome

phantomjs doesn't support es6 (ariya/phantomjs#14506)
  • Loading branch information
jupe authored Oct 17, 2017
1 parent e51ff7a commit e7f1424
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
15 changes: 5 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:6.11.3
- image: circleci/node:6.11.4-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
steps:
- checkout
#- run:
# name: update-npm
# command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
Expand All @@ -28,10 +27,6 @@ jobs:
- run:
name: build
command: npm run build
- run:
name: module-versions
command: |
./node_modules/mocha-phantomjs/bin/mocha-phantomjs --version
- run:
name: test-node
command: npm run test-node
Expand All @@ -40,7 +35,7 @@ jobs:
MOCHA_FILE: junit/test-results.xml
- run:
name: test-browser
command: npm run test-browser || true
command: npm run test-browser
- run:
name: lint
command: npm run lint
Expand All @@ -59,4 +54,4 @@ jobs:
path: coverage
prefix: coverage
- store_test_results:
path: coverage/coverage.json
path: coverage/coverage.json
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BROWSERIFY ?= browserify
MINIFY ?= minify
REPORTER ?= spec
MOCHA ?= mocha
MOCHA_PHANTOMJS ?= mocha-phantomjs
MOCHA_HEADLESS_CHROME ?= node_modules/mocha-headless-chrome/bin/start
#FILTER ?= .+
BROWSERIFIED ?= dist/opentmi-client.js
MINIFIED ?= dist/opentmi-client.min.js
Expand Down Expand Up @@ -35,7 +35,7 @@ ${BROWSER_TEST} : $(shell ${BROWSERIFY} --list ${TESTS})


test-browser: bower-install ${BROWSER_TEST}
${MOCHA_PHANTOMJS} -p node_modules/phantomjs/bin/phantomjs -R ${REPORTER} -g '${FILTER}' test/index.html
${MOCHA_HEADLESS_CHROME} -f test/index.html

test-node:
NODE_ENV=test ${MOCHA} --reporter $(REPORTER) --recursive -g '${FILTER}'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"debug": "^3.1.0",
"invariant": "^2.2.2",
"lodash": "^4.17.4",
"mocha-junit-reporter": "^1.14.0",
"socket.io-client": "^2.0.3"
},
"devDependencies": {
Expand All @@ -53,7 +52,8 @@
"istanbul": "^0.4.3",
"jsdoc": "^3.5.5",
"mocha": "^4.0.1",
"mocha-phantomjs": "^4.1.0",
"mocha-headless-chrome": "^1.5.3",
"mocha-junit-reporter": "^1.14.0",
"moxios": "^0.4.0",
"sinon": "^4.0.1",
"socket.io": "^2.0.3",
Expand Down

0 comments on commit e7f1424

Please sign in to comment.