nig*_*are 4 bitbucket karma-runner reactjs bitbucket-pipelines
我正在研究基本的 React 项目,我可以在我的 mac 上使用 chrome 运行 karma 和 mocha 测试。但是 bitbucket pipeline 说我没有 chrome,所以问题是如何在那里安装 chrome,我每次构建时都必须安装它吗?
我的yml
image: node:7.10.0
pipelines:
default:
- step:
script:
- npm install -g bower
- bower install --allow-root
- npm install
- npm test
Run Code Online (Sandbox Code Playgroud)
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
});
Run Code Online (Sandbox Code Playgroud)
};
image: node:7.10.0你的行bitbucket-pipelines.yml指定要使用的 Docker 映像。在你的例子中,它\xe2\x80\x99是一个普通的节点版本7.10.0图像,因此其中不包含Chrome。
您可以做两件事:
\n\nimage: <image-name>配置行中使用该图像。无论哪种情况,一旦您拥有合适的映像,运行管道时都将需要它,并且 Chrome 将立即可用,并且您将不需要任何类型的 \xe2\x80\x9cinstallation\xe2\x80\x9d。
\n