Skip to content

vitalets/mocha-es6-modules

Repository files navigation

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.

About

Running Mocha tests in the browser with ES6 Modules support

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published