# mocha-chrome :coffee: Run Mocha tests using headless Google Chrome [![Build Status](https://travis-ci.org/shellscape/mocha-chrome.svg?branch=master)](https://travis-ci.org/shellscape/mocha-chrome) [![Known Vulnerabilities](https://snyk.io/test/github/shellscape/mocha-chrome/badge.svg)](https://snyk.io/test/github/shellscape/mocha-chrome) [![npm version](https://badge.fury.io/js/mocha-chrome.svg)](https://badge.fury.io/js/mocha-chrome) [![GitHub version](https://badge.fury.io/gh/shellscape%2Fmocha-chrome.svg)](http://badge.fury.io/gh/shellscape%2Fmocha-chrome) [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/) [![Dependency Status](https://david-dm.org/shellscape/mocha-chrome.svg)](https://david-dm.org/shellscape/mocha-chrome) [![devDependencies Status](https://david-dm.org/shellscape/mocha-chrome/dev-status.svg)](https://david-dm.org/shellscape/mocha-chrome?type=dev) ## Requirements `mocha-chrome`requires Node v8.0.0 or higher. Unfortunately the project won't be _directly_ supporting a lower version number at this time. However, old-node users may choose to use the `--old-and-busted` flag, because your version is not the new hotness - it's old and busted; ```console --old-and-busted Take pity upon users of old-node. This option will run moche-chrome under Node < 8 using babel-register. Use at your own risk, and without support. ``` That will run the **cli** using `babel-register`, which inherently runs slower due to the nature of `babel-register`. If you're attempting to use the **api**, you'll have to mimic the `.babelrc` and `babel-register` setup in this repo. `mocha-chrome` is a dev tool, which means you can use tools like [NVM](https://github.com/creationix/nvm) and [nodenv](https://github.com/nodenv/nodenv) to manage your installed versions, and temporarily switch to v8+ to run tests on your machine. Most modern CI environments also support specifying the version of Node to run. ## Getting Started To begin, you'll need to install `mocha-chrome`: ```console $ npm install mocha-chrome --save-dev ``` Then you'll need a local npm install of mocha: ```console $ npm install mocha --save-dev ``` To run the tests, you'll need an HTML file with some basics: ```html Test
``` You can then add your tests either through an external script file or inline within a `