diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c85fbf..1a763ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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 @@ -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 @@ -59,4 +54,4 @@ jobs: path: coverage prefix: coverage - store_test_results: - path: coverage/coverage.json \ No newline at end of file + path: coverage/coverage.json diff --git a/Makefile b/Makefile index aa3a1dc..bfa524d 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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}' diff --git a/package.json b/package.json index b8355bf..c06ccda 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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",