0
我正在開發基本的反應項目,我可以在我的mac上使用chrome在karma和mocha上運行測試。 但bitbucket管道說,我沒有鉻,所以問題是如何在那裏安裝鉻,我將不得不每次與構建安裝它?Bitbucket - 您的平臺上沒有Chrome瀏覽器的二進制文件
我陽明
image: node:7.10.0
pipelines:
default:
- step:
script:
- npm install -g bower
- bower install --allow-root
- npm install
- npm test
karma.conf.js
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
'./tests/*.js'
],
exclude: [],
preprocessors: {
'./tests/*.js': ['webpack']
},
// webpack configuration
webpack: require('./webpack.dev.js'),
webpackMiddleware: {
stats: 'errors-only'
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'], //run in Chrome
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
concurrency: Infinity
});
};
作爲獎勵,如果所有工具已經在圖像中,那麼您不需要花費構建分鐘來獲取或安裝它們。 –