I'm working on basic react project and I'm able to run test with karma and mocha on my mac with chrome. But bitbucket pipeline says that I do not have a chrome, so the question is how to install chrome there and will I have to install it every time with build?
my 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
});
};
The line image: node:7.10.0
in your bitbucket-pipelines.yml
file specifies a Docker image to use. In your case, it’s a plain node version 7.10.0 image, so there is no Chrome contained in it.
There are two things you can do:
image: <image-name>
configuration line.In either case, once you have a suitable image, this will be needed when your pipeline is run and Chrome will be available immediately, and you will not need any kind of “installation”.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With