From 084d55d77eee7aadebe3ecfd4cd83760801b2f3e Mon Sep 17 00:00:00 2001 From: 38elements Date: Fri, 15 Dec 2017 13:45:00 +0900 Subject: [PATCH] Use Puppeteer --- package.json | 6 ++---- test/unit/index.js | 5 ----- test/unit/karma.conf.js | 4 +++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ea878084..688208b0 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "connect-history-api-fallback": "^1.1.0", "copy-webpack-plugin": "^4.0.0", "css-loader": "^0.25.0", - "es6-promise": "^4.0.5", "eslint": "^3.7.1", "eslint-config-standard": "^6.1.0", "eslint-friendly-formatter": "^2.0.5", @@ -54,16 +53,15 @@ "express": "^4.13.3", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", - "function-bind": "^1.0.2", "html-webpack-plugin": "^2.8.1", "http-proxy-middleware": "^0.17.2", "inject-loader": "^2.0.1", "isparta-loader": "^2.0.0", "json-loader": "^0.5.4", "karma": "^1.3.0", + "karma-chrome-launcher": "^2.2.0", "karma-coverage": "^1.1.1", "karma-mocha": "^1.2.0", - "karma-phantomjs-launcher": "^1.0.0", "karma-sinon-chai": "^1.2.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.26", @@ -73,9 +71,9 @@ "node-sass": "^3.4.2", "opn": "^4.0.2", "ora": "^0.3.0", - "phantomjs-prebuilt": "^2.1.3", "pug": "2.0.0-beta6", "pug-loader": "^2.3.0", + "puppeteer": "^0.13.0", "raw-loader": "^0.5.1", "sass-loader": "^3.2.0", "semver": "^5.3.0", diff --git a/test/unit/index.js b/test/unit/index.js index 77494061..2b58fed9 100644 --- a/test/unit/index.js +++ b/test/unit/index.js @@ -1,8 +1,3 @@ -// Polyfill fn.bind() for PhantomJS -/* eslint-disable no-extend-native */ -Function.prototype.bind = require('function-bind') -require('es6-promise').polyfill() - import Vue from 'vue' import Validation from '../../src/index' Vue.use(Validation) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index 1d828504..92b31a26 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -47,13 +47,15 @@ webpackConfig.module.loaders.some(function (loader, i) { } }) +process.env.CHROME_BIN = require('puppeteer').executablePath() + module.exports = function (config) { config.set({ // to run in additional browsers: // 1. install corresponding karma launcher // http://karma-runner.github.io/0.13/config/browsers.html // 2. add it to the `browsers` array below. - browsers: ['PhantomJS'], + browsers: ['ChromeHeadless'], frameworks: ['mocha', 'sinon-chai'], reporters: ['spec', 'coverage'], files: ['./index.js'],