Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.12 KB

README.md

File metadata and controls

33 lines (28 loc) · 1.12 KB

Mocha ES6 modules example

An example of running Mocha tests as a native ES6 modules in a browser.

  • If browser supports ES6 modules — the are used. 
  • If browser does not support ES6 modules — the page fallbacks to bundled script.

You can check it online in your browser.

With ES modules (Chrome >= 62):

Mocha tests With ES modules

Without ES modules (Firefox 57):

Mocha tests Without ES modules

Run locally

  1. Clone the repo:
    git clone https://github.com/vitalets/mocha-es6-modules.git
    cd mocha-es6-modules
  2. Install dependencies:
    npm install
  3. Build non-es6 version:
    npm run build
  4. Start local http server:
    npm run server
  5. Open http://localhost:8000 in browser.