Skip to content

mroderick/test-es6-modules-with-mocha-sinon-proxyquire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test ES6 with Mocha, Istanbul, Sinon, Proxyquire

This repository is a running example of how to configure a project for testing Babel transpiled ES6 JavaScript that uses ES6 module syntax, using MochaIstanbul, Sinon and Proxyquire without adding any dependency to whatever module bundler/loader is used for delivering the code to browsers.

Try it out

I've tested this in node 6.x and 7.x. If you're using ES6 modules, then you probably also have a fairly modern node on your system(s).

$ npm install
$ npm test
# use nyc (Istanbul CLI) to create a coverage report
$ npm run coverage

------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
All files   |       50 |      100 |       50 |       50 |                |
 hello      |      100 |      100 |      100 |      100 |                |
  hello.js  |      100 |      100 |      100 |      100 |                |
 proxyquire |        0 |      100 |        0 |        0 |                |
  hi.js     |        0 |      100 |        0 |        0 |              2 |
------------|----------|----------|----------|----------|----------------|

License

MIT: http://mrgnrdrck.mit-license.org

About

Running demo of testing ES6 modules using mocha, sinon, proxyquire

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published