Skip to content

Commit

Permalink
chore(tests): replace phantomjs with chromium (#2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and Alexander Fedyashov committed Sep 11, 2017
1 parent 49cf1d9 commit c54b157
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 9 additions & 3 deletions karma.conf.babel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import puppeteerPkg from 'puppeteer/package.json'
import Downloader from 'puppeteer/utils/ChromiumDownloader'
import config from './config'
import webpackConfig from './webpack.config.babel'

const revision = puppeteerPkg.puppeteer.chromium_revision
const revisionInfo = Downloader.revisionInfo(Downloader.currentPlatform(), revision)

process.env.CHROME_BIN = revisionInfo.executablePath

const formatError = (msg) => {
// filter out empty lines and node_modules
if (!msg.trim() || /~/.test(msg)) return ''
Expand All @@ -22,7 +29,7 @@ const formatError = (msg) => {
export default (karmaConfig) => {
karmaConfig.set({
basePath: process.cwd(),
browsers: ['PhantomJS'],
browsers: ['ChromeHeadless'],
client: {
mocha: {
reporter: 'html', // change Karma's debug.html to mocha web reporter
Expand All @@ -37,11 +44,10 @@ export default (karmaConfig) => {
includeAllSources: true,
},
files: [
'node_modules/es6-shim/es6-shim.js',
'./test/tests.bundle.js',
],
formatError,
frameworks: ['phantomjs-shim', 'mocha'],
frameworks: ['mocha'],
reporters: ['mocha', 'coverage'],
singleRun: true,
preprocessors: {
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"doctoc": "^1.3.0",
"doctrine": "^2.0.0",
"enzyme": "^2.9.1",
"es6-shim": "^0.35.3",
"eslint": "^4.4.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.7.0",
Expand All @@ -105,16 +104,15 @@
"js-beautify": "^1.6.14",
"json-loader": "^0.5.7",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
"karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.4.0",
"karma-webpack-with-fast-source-maps": "^1.10.2",
"mocha": "^3.5.0",
"node-sass": "^4.5.3",
"phantomjs-prebuilt": "^2.1.15",
"puppeteer": "^0.10.1",
"raw-loader": "^0.5.1",
"react": "^15.6.1",
"react-ace": "^5.1.2",
Expand Down

0 comments on commit c54b157

Please sign in to comment.