我正在研究基本的反应项目,我可以用我的mac上的karma和mocha进行测试。 但bitbucket管道说我没有chrome,所以问题是如何在那里安装chrome并且每次使用build都需要安装它吗?
我的yml
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
});
};
答案 0 :(得分:2)
image: node:7.10.0
文件中的行bitbucket-pipelines.yml
指定要使用的Docker镜像。在您的情况下,它是普通节点版本7.10.0图像,因此其中不包含Chrome。
您可以做两件事:
image: <image-name>
配置行中使用该图像。在任何一种情况下,一旦您有合适的图片,当您的管道运行并且Chrome将立即可用时,将需要这样做,并且您不需要任何类型的“安装”。