Skip to content

Boilerplate project for running karma with Google Chrome inside a Docker container

Notifications You must be signed in to change notification settings

stackriot-labs/chrome-karma-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running karma unit tests in Google Chrome inside Docker

This is a code example project for a Medium story about Docker/Karma/Chrome:

Running Karma tests with Headless Chrome inside Docker

The example code runs karma tests, and also has a "mock" bundle step, which just creates a result.txt file. In a real project, this build step would probably be the result of a gulp/webpack etc. command.

Running outside Docker

This assumes that you have node.js/npm/yarn installed.

  • yarn (setup environment, install dependencies)
  • yarn test (run tests)
  • yarn build (run the whole build)

Running inside Docker

This assumes that you have Docker and Docker Compose installed.

  • docker-compose build (setup environment, install dependencies)
  • docker-compose run --rm dev yarn test (run tests)
  • docker-compose run --rm dev yarn build (run the whole build)

Running on CI

  • docker-compose build (builds the container)
  • docker-compose run --rm dev yarn build (run the whole build)

License for the sample source code

Modified Beerware license: You can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. No attribution is necessary.

(To make 100 % sure you can use legally use this for whatever you want, it is also licensed as Unlicensed, MIT and/or WTFPL.)

About

Boilerplate project for running karma with Google Chrome inside a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 51.9%
  • JavaScript 48.1%